/*
 Navicat Premium Data Transfer

 Source Server         : spms-prod-Stpspms2020
 Source Server Type    : Oracle
 Source Server Version : 120200
 Source Host           : 192.168.106.98:1521
 Source Schema         : SPMS

 Target Server Type    : Oracle
 Target Server Version : 120200
 File Encoding         : 65001

 Date: 14/02/2022 16:38:51
*/

create sequence DATA_VERSION
  maxvalue 99999999999
/

create sequence BOX_NOTE_REPACKAGE
  nocache
/

create sequence ITEM_AUTO_ID_SEQ
  nocache
/

create sequence OVERSEA_DELIVERY_NOTE_DTL_SEQ
  nocache
/

create sequence OVERSEA_DN_DTL_SEQ
  nocache
/

create sequence OVERSEA_OPERATE_LOG_SEQ
  nocache
/

create sequence OVERSEA_OTHER_DTL_SEQ
  nocache
/

create sequence OVERSEA_PACKAGE_LIST_BOX_SEQ
  nocache
/

create sequence OVERSEA_PACKAGE_LIST_DTL_SEQ
  nocache
/

create sequence OVERSEA_PURCHASE_ORDER_DTL_SEQ
  nocache
/

create sequence OVERSEA_REQUISITION_DTL_SEQ
  nocache
/

create sequence OVERSEA_REQUISITION_SEQ
  nocache
/

create sequence OVERSEA_WHS_DUMP_DTL_SEQ
  nocache
/

create sequence OVERSEA_WHS_OUT_DTL_SEQ
  nocache
/

create sequence OVERSEA_WHS_OUT_SEQ
  nocache
/



-- ----------------------------
-- Table structure for COST_CENTER
-- ----------------------------
DROP TABLE "SPMS"."COST_CENTER";
CREATE TABLE "SPMS"."COST_CENTER" (
  "COST_CENTER_CODE" VARCHAR2(16 BYTE) VISIBLE NOT NULL,
  "COMPANY_CODE" VARCHAR2(8 BYTE) VISIBLE,
  "COST_CENTER_NAME" VARCHAR2(128 BYTE) VISIBLE
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."COST_CENTER"."COST_CENTER_CODE" IS '成本中心';
COMMENT ON COLUMN "SPMS"."COST_CENTER"."COMPANY_CODE" IS '公司代码';
COMMENT ON COLUMN "SPMS"."COST_CENTER"."COST_CENTER_NAME" IS '成本中心名称';
COMMENT ON TABLE "SPMS"."COST_CENTER" IS '成本中心';

-- ----------------------------
-- Table structure for INVENTORY_CHECK
-- ----------------------------
DROP TABLE "SPMS"."INVENTORY_CHECK";
CREATE TABLE "SPMS"."INVENTORY_CHECK" (
  "UUID" VARCHAR2(32 BYTE) VISIBLE NOT NULL,
  "INVENTORY_CHECK_ID" VARCHAR2(32 BYTE) VISIBLE,
  "WERKS" VARCHAR2(6 BYTE) VISIBLE,
  "WHS_LOCATION_CODE" VARCHAR2(6 BYTE) VISIBLE,
  "INVENTORY_CHECK_TYPE" VARCHAR2(2 BYTE) VISIBLE,
  "INVENTORY_CHECK_CATEGORY" VARCHAR2(2 BYTE) VISIBLE,
  "INVENTORY_CHECK_MOLD" VARCHAR2(2 BYTE) VISIBLE,
  "INVENTORY_CHECK_DATE" VARCHAR2(16 BYTE) VISIBLE,
  "INVENTORY_CHECK_RESULT" VARCHAR2(2 BYTE) VISIBLE,
  "IS_REVIEW" VARCHAR2(2 BYTE) VISIBLE,
  "INVENTORY_REVIEW_ID" VARCHAR2(32 BYTE) VISIBLE,
  "INVENTORY_CHECK_SURPLUS" VARCHAR2(32 BYTE) VISIBLE,
  "INVENTORY_CHECK_LOSS" VARCHAR2(32 BYTE) VISIBLE,
  "CREATE_DATE" VARCHAR2(16 BYTE) VISIBLE,
  "SPMS_STATUS" VARCHAR2(2 BYTE) VISIBLE,
  "REQUESTER" VARCHAR2(32 BYTE) VISIBLE,
  "OPERATOR" VARCHAR2(32 BYTE) VISIBLE,
  "REVIEWER" VARCHAR2(32 BYTE) VISIBLE,
  "APPROVER" VARCHAR2(32 BYTE) VISIBLE,
  "CREATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss'),
  "UPDATE_USERNAME" VARCHAR2(64 BYTE) VISIBLE,
  "UPDATE_TIME" DATE VISIBLE
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."INVENTORY_CHECK"."UUID" IS '仓库盘点任务UUID';
COMMENT ON COLUMN "SPMS"."INVENTORY_CHECK"."INVENTORY_CHECK_ID" IS '仓库盘点任务单号';
COMMENT ON COLUMN "SPMS"."INVENTORY_CHECK"."WERKS" IS '工厂编号';
COMMENT ON COLUMN "SPMS"."INVENTORY_CHECK"."WHS_LOCATION_CODE" IS '仓库地点代码';
COMMENT ON COLUMN "SPMS"."INVENTORY_CHECK"."INVENTORY_CHECK_TYPE" IS '是否杂货 X-备件货 M-贸易货';
COMMENT ON COLUMN "SPMS"."INVENTORY_CHECK"."INVENTORY_CHECK_CATEGORY" IS '盘点类别 1-日常盘点 2-月度盘点 3-动态盘点 4-其它盘点';
COMMENT ON COLUMN "SPMS"."INVENTORY_CHECK"."INVENTORY_CHECK_MOLD" IS '盘点类型 1-明盘 2-暗盘';
COMMENT ON COLUMN "SPMS"."INVENTORY_CHECK"."INVENTORY_CHECK_DATE" IS '盘点日期';
COMMENT ON COLUMN "SPMS"."INVENTORY_CHECK"."INVENTORY_CHECK_RESULT" IS '盘点结果 1-账实相符 2-盘盈 3-盘亏 4-盘盈盘亏';
COMMENT ON COLUMN "SPMS"."INVENTORY_CHECK"."IS_REVIEW" IS '是否复盘 1-初盘 2-复盘';
COMMENT ON COLUMN "SPMS"."INVENTORY_CHECK"."INVENTORY_REVIEW_ID" IS '复盘单据UUID';
COMMENT ON COLUMN "SPMS"."INVENTORY_CHECK"."INVENTORY_CHECK_SURPLUS" IS '盘盈单据号';
COMMENT ON COLUMN "SPMS"."INVENTORY_CHECK"."INVENTORY_CHECK_LOSS" IS '盘亏单据号';
COMMENT ON COLUMN "SPMS"."INVENTORY_CHECK"."CREATE_DATE" IS '创建日期';
COMMENT ON COLUMN "SPMS"."INVENTORY_CHECK"."SPMS_STATUS" IS '任务状态：1-待盘点；2-盘点中；3-复盘中；4-处理中；5-关闭(完成)';
COMMENT ON COLUMN "SPMS"."INVENTORY_CHECK"."REQUESTER" IS '创建人工号';
COMMENT ON COLUMN "SPMS"."INVENTORY_CHECK"."OPERATOR" IS '申请人';
COMMENT ON COLUMN "SPMS"."INVENTORY_CHECK"."REVIEWER" IS '复核人';
COMMENT ON COLUMN "SPMS"."INVENTORY_CHECK"."APPROVER" IS '审批人';
COMMENT ON COLUMN "SPMS"."INVENTORY_CHECK"."CREATE_TIME" IS '创建时间';
COMMENT ON COLUMN "SPMS"."INVENTORY_CHECK"."UPDATE_USERNAME" IS '更新人姓名';
COMMENT ON COLUMN "SPMS"."INVENTORY_CHECK"."UPDATE_TIME" IS '更新时间';
COMMENT ON TABLE "SPMS"."INVENTORY_CHECK" IS '仓库盘点任务表';

-- ----------------------------
-- Table structure for INVENTORY_CHECK_ACTION
-- ----------------------------
DROP TABLE "SPMS"."INVENTORY_CHECK_ACTION";
CREATE TABLE "SPMS"."INVENTORY_CHECK_ACTION" (
  "UUID" VARCHAR2(32 BYTE) VISIBLE NOT NULL,
  "SPMS_ID" VARCHAR2(32 BYTE) VISIBLE,
  "INVENTORY_ACTION_TYPE" VARCHAR2(6 BYTE) VISIBLE,
  "WERKS" VARCHAR2(6 BYTE) VISIBLE,
  "WHS_LOCATION_CODE" VARCHAR2(6 BYTE) VISIBLE,
  "INVENTORY_CHECK_ID" VARCHAR2(32 BYTE) VISIBLE,
  "INVENTORY_CHECK_RESULT" VARCHAR2(2 BYTE) VISIBLE,
  "INVENTORY_CHECK_TYPE" VARCHAR2(2 BYTE) VISIBLE,
  "INVENTORY_CHECK_CATEGORY" VARCHAR2(2 BYTE) VISIBLE,
  "INVENTORY_CHECK_MOLD" VARCHAR2(2 BYTE) VISIBLE,
  "CREATE_DATE" VARCHAR2(16 BYTE) VISIBLE,
  "SPMS_STATUS" VARCHAR2(2 BYTE) VISIBLE,
  "REQUESTER" VARCHAR2(32 BYTE) VISIBLE,
  "OPERATOR" VARCHAR2(32 BYTE) VISIBLE,
  "REVIEWER" VARCHAR2(32 BYTE) VISIBLE,
  "APPROVER" VARCHAR2(32 BYTE) VISIBLE,
  "CREATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss'),
  "UPDATE_USERNAME" VARCHAR2(64 BYTE) VISIBLE,
  "UPDATE_TIME" DATE VISIBLE,
  "JUSTIFICATION" VARCHAR2(255 BYTE) VISIBLE,
  "REMARKS" VARCHAR2(255 BYTE) VISIBLE,
  "POSTING_DATE" VARCHAR2(16 BYTE) VISIBLE,
  "COST_CENTER" VARCHAR2(16 BYTE) VISIBLE,
  "MOVE_TYPE" VARCHAR2(6 BYTE) VISIBLE,
  "VOUCHER_TEXT" VARCHAR2(255 BYTE) VISIBLE,
  "SAP_VOUCHER_NUMBER" VARCHAR2(16 BYTE) VISIBLE,
  "SAP_VOUCHER_YEAR" VARCHAR2(4 BYTE) VISIBLE
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."INVENTORY_CHECK_ACTION"."UUID" IS '仓库盘盈盘亏任务UUID';
COMMENT ON COLUMN "SPMS"."INVENTORY_CHECK_ACTION"."SPMS_ID" IS '仓库盘盈盘亏单号';
COMMENT ON COLUMN "SPMS"."INVENTORY_CHECK_ACTION"."INVENTORY_ACTION_TYPE" IS '盘盈盘亏类别 701-盘盈 702-盘亏';
COMMENT ON COLUMN "SPMS"."INVENTORY_CHECK_ACTION"."WERKS" IS '工厂编号';
COMMENT ON COLUMN "SPMS"."INVENTORY_CHECK_ACTION"."WHS_LOCATION_CODE" IS '仓库地点代码';
COMMENT ON COLUMN "SPMS"."INVENTORY_CHECK_ACTION"."INVENTORY_CHECK_ID" IS '盘点单据号';
COMMENT ON COLUMN "SPMS"."INVENTORY_CHECK_ACTION"."INVENTORY_CHECK_RESULT" IS '盘点结果 1-账实相符 2-盘盈 3-盘亏 4-盘盈盘亏';
COMMENT ON COLUMN "SPMS"."INVENTORY_CHECK_ACTION"."INVENTORY_CHECK_TYPE" IS '是否杂货 X-备件货 M-贸易货';
COMMENT ON COLUMN "SPMS"."INVENTORY_CHECK_ACTION"."INVENTORY_CHECK_CATEGORY" IS '盘点类别 1-日常盘点 2-月度盘点 3-动态盘点 4-其它盘点';
COMMENT ON COLUMN "SPMS"."INVENTORY_CHECK_ACTION"."INVENTORY_CHECK_MOLD" IS '盘点类型 1-明盘 2-暗盘';
COMMENT ON COLUMN "SPMS"."INVENTORY_CHECK_ACTION"."CREATE_DATE" IS '创建日期';
COMMENT ON COLUMN "SPMS"."INVENTORY_CHECK_ACTION"."SPMS_STATUS" IS '任务状态：1-草稿;2-审批中；3-审批通过(待上传SAP)；4-关闭(完成/提交SAP成功)；5-审批不通过；6-提交SAP失败；';
COMMENT ON COLUMN "SPMS"."INVENTORY_CHECK_ACTION"."REQUESTER" IS '创建人工号';
COMMENT ON COLUMN "SPMS"."INVENTORY_CHECK_ACTION"."OPERATOR" IS '申请人';
COMMENT ON COLUMN "SPMS"."INVENTORY_CHECK_ACTION"."REVIEWER" IS '复核人';
COMMENT ON COLUMN "SPMS"."INVENTORY_CHECK_ACTION"."APPROVER" IS '审批人';
COMMENT ON COLUMN "SPMS"."INVENTORY_CHECK_ACTION"."CREATE_TIME" IS '创建时间';
COMMENT ON COLUMN "SPMS"."INVENTORY_CHECK_ACTION"."UPDATE_USERNAME" IS '更新人姓名';
COMMENT ON COLUMN "SPMS"."INVENTORY_CHECK_ACTION"."UPDATE_TIME" IS '更新时间';
COMMENT ON COLUMN "SPMS"."INVENTORY_CHECK_ACTION"."JUSTIFICATION" IS '申请原因';
COMMENT ON COLUMN "SPMS"."INVENTORY_CHECK_ACTION"."REMARKS" IS '备注';
COMMENT ON COLUMN "SPMS"."INVENTORY_CHECK_ACTION"."POSTING_DATE" IS '凭证中的过账日期-用户选';
COMMENT ON COLUMN "SPMS"."INVENTORY_CHECK_ACTION"."COST_CENTER" IS '成本中心';
COMMENT ON COLUMN "SPMS"."INVENTORY_CHECK_ACTION"."MOVE_TYPE" IS '移动类型';
COMMENT ON COLUMN "SPMS"."INVENTORY_CHECK_ACTION"."VOUCHER_TEXT" IS '凭证抬头文本';
COMMENT ON COLUMN "SPMS"."INVENTORY_CHECK_ACTION"."SAP_VOUCHER_NUMBER" IS 'SAP物料凭证-提交SAP成功后回写';
COMMENT ON COLUMN "SPMS"."INVENTORY_CHECK_ACTION"."SAP_VOUCHER_YEAR" IS '会计年份/SAP凭证年份';
COMMENT ON TABLE "SPMS"."INVENTORY_CHECK_ACTION" IS '仓库盘盈盘亏';

-- ----------------------------
-- Table structure for INVENTORY_CHECK_ACTION_DTL
-- ----------------------------
DROP TABLE "SPMS"."INVENTORY_CHECK_ACTION_DTL";
CREATE TABLE "SPMS"."INVENTORY_CHECK_ACTION_DTL" (
  "UUID" VARCHAR2(32 BYTE) VISIBLE,
  "TASK_ROW_ID" VARCHAR2(6 BYTE) VISIBLE,
  "MATERIAL_NO" VARCHAR2(32 BYTE) VISIBLE,
  "BOX_NOTE" VARCHAR2(50 BYTE) VISIBLE,
  "INVENTORY_QUANTITY" NUMBER VISIBLE,
  "CHECK_QUANTITY" NUMBER VISIBLE,
  "DISCREPANCY" NUMBER VISIBLE,
  "BASIC_UNIT" VARCHAR2(32 BYTE) VISIBLE,
  "STORAGE_UUID" VARCHAR2(32 BYTE) VISIBLE,
  "REMARKS" VARCHAR2(256 BYTE) VISIBLE,
  "RELATE_ACCOUNT" VARCHAR2(16 BYTE) VISIBLE,
  "VOUCHER_ITEM_TEXT" VARCHAR2(255 BYTE) VISIBLE
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."INVENTORY_CHECK_ACTION_DTL"."UUID" IS '盘盈盘亏UUID';
COMMENT ON COLUMN "SPMS"."INVENTORY_CHECK_ACTION_DTL"."TASK_ROW_ID" IS '盘盈盘亏任务行号';
COMMENT ON COLUMN "SPMS"."INVENTORY_CHECK_ACTION_DTL"."MATERIAL_NO" IS '物料编号';
COMMENT ON COLUMN "SPMS"."INVENTORY_CHECK_ACTION_DTL"."BOX_NOTE" IS '箱码-仅用于自管仓备件管理';
COMMENT ON COLUMN "SPMS"."INVENTORY_CHECK_ACTION_DTL"."INVENTORY_QUANTITY" IS '库存数量';
COMMENT ON COLUMN "SPMS"."INVENTORY_CHECK_ACTION_DTL"."CHECK_QUANTITY" IS '实盘数量';
COMMENT ON COLUMN "SPMS"."INVENTORY_CHECK_ACTION_DTL"."DISCREPANCY" IS '差异数量';
COMMENT ON COLUMN "SPMS"."INVENTORY_CHECK_ACTION_DTL"."BASIC_UNIT" IS '基本单位';
COMMENT ON COLUMN "SPMS"."INVENTORY_CHECK_ACTION_DTL"."STORAGE_UUID" IS '储位UUID';
COMMENT ON COLUMN "SPMS"."INVENTORY_CHECK_ACTION_DTL"."REMARKS" IS '备注';
COMMENT ON COLUMN "SPMS"."INVENTORY_CHECK_ACTION_DTL"."RELATE_ACCOUNT" IS '供应商或债权人的帐号';
COMMENT ON COLUMN "SPMS"."INVENTORY_CHECK_ACTION_DTL"."VOUCHER_ITEM_TEXT" IS '项目文本';
COMMENT ON TABLE "SPMS"."INVENTORY_CHECK_ACTION_DTL" IS '盘盈盘亏明细表';

-- ----------------------------
-- Table structure for INVENTORY_CHECK_DTL
-- ----------------------------
DROP TABLE "SPMS"."INVENTORY_CHECK_DTL";
CREATE TABLE "SPMS"."INVENTORY_CHECK_DTL" (
  "UUID" VARCHAR2(32 BYTE) VISIBLE,
  "TASK_ROW_ID" VARCHAR2(6 BYTE) VISIBLE,
  "MATERIAL_NO" VARCHAR2(32 BYTE) VISIBLE,
  "BOX_NOTE" VARCHAR2(50 BYTE) VISIBLE,
  "INVENTORY_QUANTITY" NUMBER VISIBLE,
  "CHECK_QUANTITY" NUMBER VISIBLE,
  "DISCREPANCY" NUMBER VISIBLE,
  "BASIC_UNIT" VARCHAR2(32 BYTE) VISIBLE,
  "STORAGE_UUID" VARCHAR2(32 BYTE) VISIBLE,
  "REMARKS" VARCHAR2(256 BYTE) VISIBLE
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."INVENTORY_CHECK_DTL"."UUID" IS '盘点任务UUID';
COMMENT ON COLUMN "SPMS"."INVENTORY_CHECK_DTL"."TASK_ROW_ID" IS '盘点任务行号';
COMMENT ON COLUMN "SPMS"."INVENTORY_CHECK_DTL"."MATERIAL_NO" IS '物料编号';
COMMENT ON COLUMN "SPMS"."INVENTORY_CHECK_DTL"."BOX_NOTE" IS '箱码-仅用于自管仓备件管理';
COMMENT ON COLUMN "SPMS"."INVENTORY_CHECK_DTL"."INVENTORY_QUANTITY" IS '库存数量';
COMMENT ON COLUMN "SPMS"."INVENTORY_CHECK_DTL"."CHECK_QUANTITY" IS '实盘数量';
COMMENT ON COLUMN "SPMS"."INVENTORY_CHECK_DTL"."DISCREPANCY" IS '差异数量';
COMMENT ON COLUMN "SPMS"."INVENTORY_CHECK_DTL"."BASIC_UNIT" IS '基本单位';
COMMENT ON COLUMN "SPMS"."INVENTORY_CHECK_DTL"."STORAGE_UUID" IS '储位UUID';
COMMENT ON COLUMN "SPMS"."INVENTORY_CHECK_DTL"."REMARKS" IS '备注';
COMMENT ON TABLE "SPMS"."INVENTORY_CHECK_DTL" IS '盘点任务表明细表';

-- ----------------------------
-- Table structure for MATERIAL_APPLICATION
-- ----------------------------
DROP TABLE "SPMS"."MATERIAL_APPLICATION";
CREATE TABLE "SPMS"."MATERIAL_APPLICATION" (
  "APPLICATION_UUID" VARCHAR2(32 BYTE) VISIBLE NOT NULL,
  "APPLICATION_ID" VARCHAR2(32 BYTE) VISIBLE,
  "USER_ID" VARCHAR2(60 BYTE) VISIBLE,
  "WERKS" VARCHAR2(10 BYTE) VISIBLE,
  "WORKSHOP_CODE" VARCHAR2(10 BYTE) VISIBLE,
  "APPLICATION_TYPE" VARCHAR2(2 BYTE) VISIBLE,
  "SPMS_STATUS" VARCHAR2(2 BYTE) VISIBLE,
  "REMARKS" VARCHAR2(255 BYTE) VISIBLE,
  "APPLICATION_DATE" VARCHAR2(16 BYTE) VISIBLE,
  "CREATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss'),
  "UPDATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss'),
  "CPX" VARCHAR2(2 BYTE) VISIBLE,
  "OA_BIANHAO" VARCHAR2(16 BYTE) VISIBLE,
  "OA_ORDER_NO" VARCHAR2(32 BYTE) VISIBLE,
  "OA_APPROVAL_DATE" VARCHAR2(16 BYTE) VISIBLE,
  "REVIEWER_WORK_CODE" VARCHAR2(10 BYTE) VISIBLE,
  "OA_SUBMIT_DATE" DATE VISIBLE
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."MATERIAL_APPLICATION"."APPLICATION_UUID" IS '物料申请单uuid';
COMMENT ON COLUMN "SPMS"."MATERIAL_APPLICATION"."APPLICATION_ID" IS '物料申请单号（工厂+车间+序列号）';
COMMENT ON COLUMN "SPMS"."MATERIAL_APPLICATION"."USER_ID" IS '用户工号';
COMMENT ON COLUMN "SPMS"."MATERIAL_APPLICATION"."WERKS" IS '工厂代码';
COMMENT ON COLUMN "SPMS"."MATERIAL_APPLICATION"."WORKSHOP_CODE" IS '车间代码（申请部门）';
COMMENT ON COLUMN "SPMS"."MATERIAL_APPLICATION"."APPLICATION_TYPE" IS '申请类型（1-增补物料；2-修改物料信息）';
COMMENT ON COLUMN "SPMS"."MATERIAL_APPLICATION"."SPMS_STATUS" IS '物料申请单状态（0-删除；1-保存；2-提交OA成功；3-提交OA失败；4-OA审批通过；5-OA审批不通过；6-完成）';
COMMENT ON COLUMN "SPMS"."MATERIAL_APPLICATION"."REMARKS" IS '备注信息';
COMMENT ON COLUMN "SPMS"."MATERIAL_APPLICATION"."APPLICATION_DATE" IS '申请日期';
COMMENT ON COLUMN "SPMS"."MATERIAL_APPLICATION"."CREATE_TIME" IS '创建时间';
COMMENT ON COLUMN "SPMS"."MATERIAL_APPLICATION"."UPDATE_TIME" IS '更新时间，自动生成';
COMMENT ON COLUMN "SPMS"."MATERIAL_APPLICATION"."CPX" IS '备件类别（0建材专属；1快消专属；2五金专属；3通用专属；4非备件类）';
COMMENT ON COLUMN "SPMS"."MATERIAL_APPLICATION"."OA_BIANHAO" IS '提交OA返回的编号';
COMMENT ON COLUMN "SPMS"."MATERIAL_APPLICATION"."OA_ORDER_NO" IS 'OA流水号';
COMMENT ON COLUMN "SPMS"."MATERIAL_APPLICATION"."OA_APPROVAL_DATE" IS 'OA审批通过日期yyyy-MM-dd';
COMMENT ON COLUMN "SPMS"."MATERIAL_APPLICATION"."REVIEWER_WORK_CODE" IS '物料审核员ID';
COMMENT ON COLUMN "SPMS"."MATERIAL_APPLICATION"."OA_SUBMIT_DATE" IS 'OA提交日期';
COMMENT ON TABLE "SPMS"."MATERIAL_APPLICATION" IS '物料申请单表表头';

-- ----------------------------
-- Table structure for MATERIAL_APPLICATION_DTL
-- ----------------------------
DROP TABLE "SPMS"."MATERIAL_APPLICATION_DTL";
CREATE TABLE "SPMS"."MATERIAL_APPLICATION_DTL" (
  "APPLICATION_UUID" VARCHAR2(32 BYTE) VISIBLE,
  "APPLICATION_ITEM" VARCHAR2(6 BYTE) VISIBLE,
  "MATERIAL_EN_DESC" VARCHAR2(255 BYTE) VISIBLE,
  "SPECS" VARCHAR2(255 BYTE) VISIBLE,
  "BASIC_UNIT" VARCHAR2(6 BYTE) VISIBLE,
  "MATERIAL_MODEL" VARCHAR2(255 BYTE) VISIBLE,
  "SUPPLIER_MATERIAL_NO" VARCHAR2(255 BYTE) VISIBLE,
  "SUPPLY_DESC" VARCHAR2(255 BYTE) VISIBLE,
  "RELATE_EQUIPMENT" VARCHAR2(255 BYTE) VISIBLE,
  "EQUIPMENT_SPEC" VARCHAR2(128 BYTE) VISIBLE,
  "EQUIPEMNT_SUPPLIER" VARCHAR2(128 BYTE) VISIBLE,
  "EQUIPMENT_BRAND" VARCHAR2(64 BYTE) VISIBLE,
  "PRODUCT_LEVEL_LARGE_DESC" VARCHAR2(128 BYTE) VISIBLE,
  "PRODUCT_LEVEL_MID_DESC" VARCHAR2(128 BYTE) VISIBLE,
  "PRODUCT_LEVEL_SMALL_DESC" VARCHAR2(128 BYTE) VISIBLE,
  "PICTURE" VARCHAR2(1000 BYTE) VISIBLE,
  "REMARKS" VARCHAR2(255 BYTE) VISIBLE,
  "AUTO_ID" NUMBER VISIBLE NOT NULL,
  "PURCHASE_USERNAME" VARCHAR2(64 BYTE) VISIBLE,
  "SPARE_FIELD" VARCHAR2(64 BYTE) VISIBLE,
  "MATERIAL_NO" VARCHAR2(40 BYTE) VISIBLE,
  "THIRD_PARTY_PLATFORM" VARCHAR2(64 BYTE) VISIBLE,
  "LINK" VARCHAR2(1000 BYTE) VISIBLE,
  "SKU" VARCHAR2(64 BYTE) VISIBLE
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."MATERIAL_APPLICATION_DTL"."APPLICATION_UUID" IS '物料申请单uuid';
COMMENT ON COLUMN "SPMS"."MATERIAL_APPLICATION_DTL"."APPLICATION_ITEM" IS '物料申请单行号';
COMMENT ON COLUMN "SPMS"."MATERIAL_APPLICATION_DTL"."MATERIAL_EN_DESC" IS '物料名称/描述';
COMMENT ON COLUMN "SPMS"."MATERIAL_APPLICATION_DTL"."SPECS" IS '规格型号';
COMMENT ON COLUMN "SPMS"."MATERIAL_APPLICATION_DTL"."BASIC_UNIT" IS '基本单位';
COMMENT ON COLUMN "SPMS"."MATERIAL_APPLICATION_DTL"."MATERIAL_MODEL" IS '材质';
COMMENT ON COLUMN "SPMS"."MATERIAL_APPLICATION_DTL"."SUPPLIER_MATERIAL_NO" IS '图号/订货号';
COMMENT ON COLUMN "SPMS"."MATERIAL_APPLICATION_DTL"."SUPPLY_DESC" IS '其他技术补充参数';
COMMENT ON COLUMN "SPMS"."MATERIAL_APPLICATION_DTL"."RELATE_EQUIPMENT" IS '配套设备名称';
COMMENT ON COLUMN "SPMS"."MATERIAL_APPLICATION_DTL"."EQUIPMENT_SPEC" IS '设备型号';
COMMENT ON COLUMN "SPMS"."MATERIAL_APPLICATION_DTL"."EQUIPEMNT_SUPPLIER" IS '设备供应商';
COMMENT ON COLUMN "SPMS"."MATERIAL_APPLICATION_DTL"."EQUIPMENT_BRAND" IS '设备品牌';
COMMENT ON COLUMN "SPMS"."MATERIAL_APPLICATION_DTL"."PRODUCT_LEVEL_LARGE_DESC" IS '备件大类';
COMMENT ON COLUMN "SPMS"."MATERIAL_APPLICATION_DTL"."PRODUCT_LEVEL_MID_DESC" IS '备件次级分类';
COMMENT ON COLUMN "SPMS"."MATERIAL_APPLICATION_DTL"."PRODUCT_LEVEL_SMALL_DESC" IS '备件小类';
COMMENT ON COLUMN "SPMS"."MATERIAL_APPLICATION_DTL"."PICTURE" IS '备件图片';
COMMENT ON COLUMN "SPMS"."MATERIAL_APPLICATION_DTL"."REMARKS" IS '备注信息';
COMMENT ON COLUMN "SPMS"."MATERIAL_APPLICATION_DTL"."AUTO_ID" IS '物料申请单明细自增ID';
COMMENT ON COLUMN "SPMS"."MATERIAL_APPLICATION_DTL"."PURCHASE_USERNAME" IS '采购员（绑定采购组）';
COMMENT ON COLUMN "SPMS"."MATERIAL_APPLICATION_DTL"."SPARE_FIELD" IS '备用字段1';
COMMENT ON COLUMN "SPMS"."MATERIAL_APPLICATION_DTL"."THIRD_PARTY_PLATFORM" IS '第三方平台';
COMMENT ON COLUMN "SPMS"."MATERIAL_APPLICATION_DTL"."LINK" IS '产品网址';
COMMENT ON COLUMN "SPMS"."MATERIAL_APPLICATION_DTL"."SKU" IS '订货编码';
COMMENT ON TABLE "SPMS"."MATERIAL_APPLICATION_DTL" IS '物料申请单明细表';

-- ----------------------------
-- Table structure for MATERIAL_CATEGORY
-- ----------------------------
DROP TABLE "SPMS"."MATERIAL_CATEGORY";
CREATE TABLE "SPMS"."MATERIAL_CATEGORY" (
  "CATEGORY_ID" NUMBER VISIBLE NOT NULL,
  "CATEGORY_LEVEL" NUMBER VISIBLE NOT NULL,
  "PARENT_ID" NUMBER VISIBLE DEFAULT 0 NOT NULL,
  "CATEGORY_NAME" VARCHAR2(128 BYTE) VISIBLE NOT NULL,
  "CATEGORY_RANK" NUMBER VISIBLE DEFAULT 0 NOT NULL,
  "DESCRIPTION" VARCHAR2(128 BYTE) VISIBLE,
  "CREATE_USERID" VARCHAR2(32 BYTE) VISIBLE,
  "CREATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'),
                                     'yyyy-mm-dd hh24:mi:ss'),
  "UPDATE_USERID" VARCHAR2(32 BYTE) VISIBLE,
  "UPDATE_TIME" DATE VISIBLE,
  "IS_DELETED" VARCHAR2(8 BYTE) VISIBLE DEFAULT '0' NOT NULL,
  "CATEGORY_EN_NAME" VARCHAR2(50 BYTE) VISIBLE
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."MATERIAL_CATEGORY"."CATEGORY_ID" IS '物料分类编码';
COMMENT ON COLUMN "SPMS"."MATERIAL_CATEGORY"."CATEGORY_LEVEL" IS '物料分类级别';
COMMENT ON COLUMN "SPMS"."MATERIAL_CATEGORY"."PARENT_ID" IS '父分类ID';
COMMENT ON COLUMN "SPMS"."MATERIAL_CATEGORY"."CATEGORY_NAME" IS '物料分类名称';
COMMENT ON COLUMN "SPMS"."MATERIAL_CATEGORY"."CATEGORY_RANK" IS '排序值（字段越大越靠前）';
COMMENT ON COLUMN "SPMS"."MATERIAL_CATEGORY"."DESCRIPTION" IS '目录描述';
COMMENT ON COLUMN "SPMS"."MATERIAL_CATEGORY"."CREATE_USERID" IS '创建者ID';
COMMENT ON COLUMN "SPMS"."MATERIAL_CATEGORY"."CREATE_TIME" IS '创建时间';
COMMENT ON COLUMN "SPMS"."MATERIAL_CATEGORY"."UPDATE_USERID" IS '更新者ID';
COMMENT ON COLUMN "SPMS"."MATERIAL_CATEGORY"."UPDATE_TIME" IS '更新时间';
COMMENT ON COLUMN "SPMS"."MATERIAL_CATEGORY"."IS_DELETED" IS '是否删除-1是；默认0否';
COMMENT ON COLUMN "SPMS"."MATERIAL_CATEGORY"."CATEGORY_EN_NAME" IS '物料分类英文名称';
COMMENT ON TABLE "SPMS"."MATERIAL_CATEGORY" IS '物料目录表';

-- ----------------------------
-- Table structure for MATERIAL_PHOTOS
-- ----------------------------
DROP TABLE "SPMS"."MATERIAL_PHOTOS";
CREATE TABLE "SPMS"."MATERIAL_PHOTOS" (
  "MATERIAL_NO" VARCHAR2(32 BYTE) VISIBLE NOT NULL,
  "PHOTOS" VARCHAR2(200 BYTE) VISIBLE NOT NULL
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;

-- ----------------------------
-- Table structure for MATERIAL_SAP
-- ----------------------------
DROP TABLE "SPMS"."MATERIAL_SAP";
CREATE TABLE "SPMS"."MATERIAL_SAP" (
  "MATERIAL_NO" VARCHAR2(32 BYTE) VISIBLE NOT NULL,
  "MATERIAL_ZH_DESC" VARCHAR2(128 BYTE) VISIBLE,
  "SPMS_MARK" VARCHAR2(16 BYTE) VISIBLE DEFAULT NULL,
  "MATERIAL_EN_DESC" VARCHAR2(128 BYTE) VISIBLE,
  "PRODUCT_LEVEL_LARGE" VARCHAR2(32 BYTE) VISIBLE,
  "PRODUCT_LEVEL_LARGE_DESC" VARCHAR2(255 BYTE) VISIBLE,
  "PRODUCT_LEVEL_MID" VARCHAR2(32 BYTE) VISIBLE,
  "PRODUCT_LEVEL_MID_DESC" VARCHAR2(255 BYTE) VISIBLE,
  "PRODUCT_LEVEL_SMALL" VARCHAR2(32 BYTE) VISIBLE DEFAULT NULL,
  "PRODUCT_LEVEL_SMALL_DESC" VARCHAR2(225 BYTE) VISIBLE DEFAULT NULL,
  "PRODUCT_LEVEL" VARCHAR2(64 BYTE) VISIBLE,
  "PRODUCT_LEVEL_DESC" VARCHAR2(128 BYTE) VISIBLE,
  "MATERIAL_NAME" VARCHAR2(128 BYTE) VISIBLE,
  "SPECS" VARCHAR2(128 BYTE) VISIBLE DEFAULT NULL,
  "MATERIAL_MODEL" VARCHAR2(64 BYTE) VISIBLE DEFAULT NULL,
  "SUPPLY_DESC" VARCHAR2(128 BYTE) VISIBLE DEFAULT NULL,
  "BRAND" VARCHAR2(64 BYTE) VISIBLE DEFAULT NULL,
  "SUPPLIER_MATERIAL_NO" VARCHAR2(64 BYTE) VISIBLE DEFAULT NULL,
  "BASIC_UNIT" VARCHAR2(16 BYTE) VISIBLE DEFAULT NULL,
  "PURCHASE_UNIT" VARCHAR2(16 BYTE) VISIBLE DEFAULT NULL,
  "NET_WEIGHT" VARCHAR2(32 BYTE) VISIBLE DEFAULT NULL,
  "GROSS_WEIGHT" VARCHAR2(32 BYTE) VISIBLE DEFAULT NULL,
  "WEIGHT_UNIT" VARCHAR2(32 BYTE) VISIBLE DEFAULT NULL,
  "VOLUME_QTY" VARCHAR2(32 BYTE) VISIBLE DEFAULT NULL,
  "VOLUME_UNIT" VARCHAR2(32 BYTE) VISIBLE DEFAULT NULL,
  "LIGHT_HEAVY_MARK" VARCHAR2(16 BYTE) VISIBLE DEFAULT NULL,
  "IS_DELETE" VARCHAR2(16 BYTE) VISIBLE DEFAULT NULL,
  "MATERIAL_STATUS" VARCHAR2(16 BYTE) VISIBLE DEFAULT NULL,
  "CREATE_DATE" VARCHAR2(16 BYTE) VISIBLE,
  "SPMS_CREATE_TIME" DATE VISIBLE,
  "UNIT_SALES" VARCHAR2(6 BYTE) VISIBLE,
  "NUMERATOR" NUMBER VISIBLE,
  "DENOMINATOR" NUMBER VISIBLE,
  "MATERIAL_STANDARD" VARCHAR2(32 BYTE) VISIBLE,
  "ON_MALL" VARCHAR2(3 BYTE) VISIBLE,
  "MOVEMENT_TYPE" VARCHAR2(6 BYTE) VISIBLE,
  "PRODUCT_ADDRESS" VARCHAR2(255 BYTE) VISIBLE,
  "ORDER_CODE" VARCHAR2(128 BYTE) VISIBLE,
  "PURCHASE_GROUP" VARCHAR2(6 BYTE) VISIBLE,
  "PURCHASE_GROUP_DESC" VARCHAR2(64 BYTE) VISIBLE,
  "RESERVED_FIELD" VARCHAR2(32 BYTE) VISIBLE
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."MATERIAL_SAP"."MATERIAL_NO" IS '物料编码';
COMMENT ON COLUMN "SPMS"."MATERIAL_SAP"."MATERIAL_ZH_DESC" IS '物料中文描述';
COMMENT ON COLUMN "SPMS"."MATERIAL_SAP"."SPMS_MARK" IS 'SPMS标识';
COMMENT ON COLUMN "SPMS"."MATERIAL_SAP"."MATERIAL_EN_DESC" IS '物料英文描述';
COMMENT ON COLUMN "SPMS"."MATERIAL_SAP"."PRODUCT_LEVEL_LARGE" IS '产品层次 大类';
COMMENT ON COLUMN "SPMS"."MATERIAL_SAP"."PRODUCT_LEVEL_LARGE_DESC" IS '产品层次 大类描述';
COMMENT ON COLUMN "SPMS"."MATERIAL_SAP"."PRODUCT_LEVEL_MID" IS '产品层次 中级分类';
COMMENT ON COLUMN "SPMS"."MATERIAL_SAP"."PRODUCT_LEVEL_MID_DESC" IS '产品层次 中类描述';
COMMENT ON COLUMN "SPMS"."MATERIAL_SAP"."PRODUCT_LEVEL_SMALL" IS '产品层次 小类';
COMMENT ON COLUMN "SPMS"."MATERIAL_SAP"."PRODUCT_LEVEL_SMALL_DESC" IS '产品层次 小类描述';
COMMENT ON COLUMN "SPMS"."MATERIAL_SAP"."PRODUCT_LEVEL" IS '产品层次_组类';
COMMENT ON COLUMN "SPMS"."MATERIAL_SAP"."PRODUCT_LEVEL_DESC" IS '产品层次_组类描述';
COMMENT ON COLUMN "SPMS"."MATERIAL_SAP"."MATERIAL_NAME" IS '物料名称';
COMMENT ON COLUMN "SPMS"."MATERIAL_SAP"."SPECS" IS '规格尺寸';
COMMENT ON COLUMN "SPMS"."MATERIAL_SAP"."MATERIAL_MODEL" IS '材质';
COMMENT ON COLUMN "SPMS"."MATERIAL_SAP"."SUPPLY_DESC" IS '其他技术补充参数';
COMMENT ON COLUMN "SPMS"."MATERIAL_SAP"."BRAND" IS '品牌/厂商';
COMMENT ON COLUMN "SPMS"."MATERIAL_SAP"."SUPPLIER_MATERIAL_NO" IS '图号';
COMMENT ON COLUMN "SPMS"."MATERIAL_SAP"."BASIC_UNIT" IS '基本计量单位';
COMMENT ON COLUMN "SPMS"."MATERIAL_SAP"."PURCHASE_UNIT" IS '采购单位';
COMMENT ON COLUMN "SPMS"."MATERIAL_SAP"."NET_WEIGHT" IS '净重';
COMMENT ON COLUMN "SPMS"."MATERIAL_SAP"."GROSS_WEIGHT" IS '毛重';
COMMENT ON COLUMN "SPMS"."MATERIAL_SAP"."WEIGHT_UNIT" IS '重量单位';
COMMENT ON COLUMN "SPMS"."MATERIAL_SAP"."VOLUME_QTY" IS '体积';
COMMENT ON COLUMN "SPMS"."MATERIAL_SAP"."VOLUME_UNIT" IS '体积单位';
COMMENT ON COLUMN "SPMS"."MATERIAL_SAP"."LIGHT_HEAVY_MARK" IS '轻/重货标识';
COMMENT ON COLUMN "SPMS"."MATERIAL_SAP"."IS_DELETE" IS '删除标识';
COMMENT ON COLUMN "SPMS"."MATERIAL_SAP"."MATERIAL_STATUS" IS '物料状态（集团层级）';
COMMENT ON COLUMN "SPMS"."MATERIAL_SAP"."CREATE_DATE" IS '物料创建日期';
COMMENT ON COLUMN "SPMS"."MATERIAL_SAP"."SPMS_CREATE_TIME" IS 'SPMS创建时间';
COMMENT ON COLUMN "SPMS"."MATERIAL_SAP"."UNIT_SALES" IS '销售单位';
COMMENT ON COLUMN "SPMS"."MATERIAL_SAP"."NUMERATOR" IS '销售单位数量与基本单位数量相比的分母';
COMMENT ON COLUMN "SPMS"."MATERIAL_SAP"."DENOMINATOR" IS '销售单位数量与基本单位数量相比的分子';
COMMENT ON COLUMN "SPMS"."MATERIAL_SAP"."MATERIAL_STANDARD" IS '物料企标国标/用于判断物料是否可以添加到请购目录';
COMMENT ON COLUMN "SPMS"."MATERIAL_SAP"."ON_MALL" IS '是否上架商城';
COMMENT ON COLUMN "SPMS"."MATERIAL_SAP"."MOVEMENT_TYPE" IS '默认移动类型';
COMMENT ON COLUMN "SPMS"."MATERIAL_SAP"."PRODUCT_ADDRESS" IS '产品地址';
COMMENT ON COLUMN "SPMS"."MATERIAL_SAP"."ORDER_CODE" IS '订货编码';
COMMENT ON COLUMN "SPMS"."MATERIAL_SAP"."PURCHASE_GROUP" IS '采购组';
COMMENT ON COLUMN "SPMS"."MATERIAL_SAP"."PURCHASE_GROUP_DESC" IS '采购组描述';
COMMENT ON COLUMN "SPMS"."MATERIAL_SAP"."RESERVED_FIELD" IS '第三方平台(预留字段)';
COMMENT ON TABLE "SPMS"."MATERIAL_SAP" IS '物料表SAP';

-- ----------------------------
-- Table structure for MATERIAL_SAP_WERKS_RELATION
-- ----------------------------
DROP TABLE "SPMS"."MATERIAL_SAP_WERKS_RELATION";
CREATE TABLE "SPMS"."MATERIAL_SAP_WERKS_RELATION" (
  "MATERIAL_NO" VARCHAR2(32 BYTE) VISIBLE DEFAULT NULL,
  "WERKS" VARCHAR2(6 BYTE) VISIBLE,
  "IS_DELETE" VARCHAR2(2 BYTE) VISIBLE,
  "MATERIAL_STATUS" VARCHAR2(2 BYTE) VISIBLE
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."MATERIAL_SAP_WERKS_RELATION"."MATERIAL_NO" IS '物料编码';
COMMENT ON COLUMN "SPMS"."MATERIAL_SAP_WERKS_RELATION"."WERKS" IS '工厂代码';
COMMENT ON COLUMN "SPMS"."MATERIAL_SAP_WERKS_RELATION"."IS_DELETE" IS '删除标识（工厂层级）';
COMMENT ON COLUMN "SPMS"."MATERIAL_SAP_WERKS_RELATION"."MATERIAL_STATUS" IS '物料状态（工厂层级）';
COMMENT ON TABLE "SPMS"."MATERIAL_SAP_WERKS_RELATION" IS '物料工厂关系表';

-- ----------------------------
-- Table structure for MATERIAL_SPMS
-- ----------------------------
DROP TABLE "SPMS"."MATERIAL_SPMS";
CREATE TABLE "SPMS"."MATERIAL_SPMS" (
  "CATEGORY_ID" NUMBER VISIBLE,
  "MATERIAL_NO" VARCHAR2(32 BYTE) VISIBLE,
  "UUID" VARCHAR2(32 BYTE) VISIBLE DEFAULT sys_guid() NOT NULL
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."MATERIAL_SPMS"."CATEGORY_ID" IS '目录分类编号-三级目录编号';
COMMENT ON COLUMN "SPMS"."MATERIAL_SPMS"."MATERIAL_NO" IS '物料编号';
COMMENT ON TABLE "SPMS"."MATERIAL_SPMS" IS '物料表spms信息';

-- ----------------------------
-- Table structure for MATERIAL_SRM_LONG_CONTRACT
-- ----------------------------
DROP TABLE "SPMS"."MATERIAL_SRM_LONG_CONTRACT";
CREATE TABLE "SPMS"."MATERIAL_SRM_LONG_CONTRACT" (
  "MATERIAL_NO" VARCHAR2(32 BYTE) VISIBLE NOT NULL,
  "LONG_CONTRACT_CODE" VARCHAR2(128 BYTE) VISIBLE NOT NULL,
  "SUPPLIER_CODE" VARCHAR2(32 BYTE) VISIBLE,
  "SUPPLIER_NAME" VARCHAR2(128 BYTE) VISIBLE,
  "START_DATE" VARCHAR2(32 BYTE) VISIBLE,
  "END_DATE" VARCHAR2(32 BYTE) VISIBLE,
  "WERKS" VARCHAR2(32 BYTE) VISIBLE,
  "PROCUREMENT_ORGANIZATION" VARCHAR2(32 BYTE) VISIBLE,
  "TAX_PRICE" NUMBER(18,6) VISIBLE,
  "QUANTITY" VARCHAR2(32 BYTE) VISIBLE,
  "UNIT" VARCHAR2(32 BYTE) VISIBLE,
  "CURRENCY_CODE" VARCHAR2(32 BYTE) VISIBLE,
  "MATERIAL_PIC_LINK" VARCHAR2(32 BYTE) VISIBLE,
  "TAX_CODE" VARCHAR2(32 BYTE) VISIBLE,
  "TAX_RATE" VARCHAR2(32 BYTE) VISIBLE,
  "PURCHASING_CYCLE" VARCHAR2(128 BYTE) VISIBLE,
  "MIN_PACK_QUANTITY" VARCHAR2(32 BYTE) VISIBLE,
  "MIN_ORDER_QUANTITY" VARCHAR2(32 BYTE) VISIBLE,
  "BRAND" VARCHAR2(32 BYTE) VISIBLE,
  "SOURCE_GOODS" VARCHAR2(32 BYTE) VISIBLE,
  "SPMS_STATUS" VARCHAR2(32 BYTE) VISIBLE
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."MATERIAL_SRM_LONG_CONTRACT"."MATERIAL_NO" IS '物料编号';
COMMENT ON COLUMN "SPMS"."MATERIAL_SRM_LONG_CONTRACT"."LONG_CONTRACT_CODE" IS '长协编号';
COMMENT ON COLUMN "SPMS"."MATERIAL_SRM_LONG_CONTRACT"."SUPPLIER_CODE" IS '供应商编号';
COMMENT ON COLUMN "SPMS"."MATERIAL_SRM_LONG_CONTRACT"."SUPPLIER_NAME" IS '供应商名称';
COMMENT ON COLUMN "SPMS"."MATERIAL_SRM_LONG_CONTRACT"."START_DATE" IS '有效期起始日';
COMMENT ON COLUMN "SPMS"."MATERIAL_SRM_LONG_CONTRACT"."END_DATE" IS '有效期截止日';
COMMENT ON COLUMN "SPMS"."MATERIAL_SRM_LONG_CONTRACT"."WERKS" IS '工厂';
COMMENT ON COLUMN "SPMS"."MATERIAL_SRM_LONG_CONTRACT"."PROCUREMENT_ORGANIZATION" IS '采购组织';
COMMENT ON COLUMN "SPMS"."MATERIAL_SRM_LONG_CONTRACT"."TAX_PRICE" IS '含税价';
COMMENT ON COLUMN "SPMS"."MATERIAL_SRM_LONG_CONTRACT"."QUANTITY" IS '数量';
COMMENT ON COLUMN "SPMS"."MATERIAL_SRM_LONG_CONTRACT"."UNIT" IS '单位';
COMMENT ON COLUMN "SPMS"."MATERIAL_SRM_LONG_CONTRACT"."CURRENCY_CODE" IS '币种';
COMMENT ON COLUMN "SPMS"."MATERIAL_SRM_LONG_CONTRACT"."MATERIAL_PIC_LINK" IS '链接地址';
COMMENT ON COLUMN "SPMS"."MATERIAL_SRM_LONG_CONTRACT"."TAX_CODE" IS '税码';
COMMENT ON COLUMN "SPMS"."MATERIAL_SRM_LONG_CONTRACT"."TAX_RATE" IS '税率';
COMMENT ON COLUMN "SPMS"."MATERIAL_SRM_LONG_CONTRACT"."PURCHASING_CYCLE" IS '采购周期';
COMMENT ON COLUMN "SPMS"."MATERIAL_SRM_LONG_CONTRACT"."MIN_PACK_QUANTITY" IS '最小包装数量';
COMMENT ON COLUMN "SPMS"."MATERIAL_SRM_LONG_CONTRACT"."MIN_ORDER_QUANTITY" IS '最小订单数量';
COMMENT ON COLUMN "SPMS"."MATERIAL_SRM_LONG_CONTRACT"."BRAND" IS '品牌';
COMMENT ON COLUMN "SPMS"."MATERIAL_SRM_LONG_CONTRACT"."SOURCE_GOODS" IS '货源地';
COMMENT ON COLUMN "SPMS"."MATERIAL_SRM_LONG_CONTRACT"."SPMS_STATUS" IS 'spms状态';
COMMENT ON TABLE "SPMS"."MATERIAL_SRM_LONG_CONTRACT" IS 'SRM长协表';

-- ----------------------------
-- Table structure for MATERIAL_STOCK_SAP
-- ----------------------------
DROP TABLE "SPMS"."MATERIAL_STOCK_SAP";
CREATE TABLE "SPMS"."MATERIAL_STOCK_SAP" (
  "WERKS" VARCHAR2(6 BYTE) VISIBLE,
  "WHS_LOCATION_CODE" VARCHAR2(6 BYTE) VISIBLE,
  "MATERIAL_NO" VARCHAR2(32 BYTE) VISIBLE,
  "QUANTITY" NUMBER VISIBLE
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."MATERIAL_STOCK_SAP"."WERKS" IS '工厂代码';
COMMENT ON COLUMN "SPMS"."MATERIAL_STOCK_SAP"."WHS_LOCATION_CODE" IS '仓库-仓库地点代码';
COMMENT ON COLUMN "SPMS"."MATERIAL_STOCK_SAP"."MATERIAL_NO" IS '物料编号';
COMMENT ON COLUMN "SPMS"."MATERIAL_STOCK_SAP"."QUANTITY" IS '数量-基本单位';
COMMENT ON TABLE "SPMS"."MATERIAL_STOCK_SAP" IS '物料SAP库存表—库存同步';

-- ----------------------------
-- Table structure for MOVEMENT_TYPE
-- ----------------------------
DROP TABLE "SPMS"."MOVEMENT_TYPE";
CREATE TABLE "SPMS"."MOVEMENT_TYPE" (
  "UUID" VARCHAR2(32 BYTE) VISIBLE NOT NULL,
  "MOVEMENT_TYPE" VARCHAR2(16 BYTE) VISIBLE,
  "MOVEMENT_TYPE_ZH_DESC" VARCHAR2(255 BYTE) VISIBLE,
  "MOVEMENT_TYPE_EN_DESC" VARCHAR2(255 BYTE) VISIBLE,
  "APPLICABLE_BUSINESS" VARCHAR2(255 BYTE) VISIBLE,
  "REMARKS" VARCHAR2(255 BYTE) VISIBLE,
  "CREATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss'),
  "UPDATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss')
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."MOVEMENT_TYPE"."UUID" IS '唯一uuid';
COMMENT ON COLUMN "SPMS"."MOVEMENT_TYPE"."MOVEMENT_TYPE" IS 'SAP出入库类型';
COMMENT ON COLUMN "SPMS"."MOVEMENT_TYPE"."APPLICABLE_BUSINESS" IS '适用业务内容';
COMMENT ON COLUMN "SPMS"."MOVEMENT_TYPE"."REMARKS" IS '备注';
COMMENT ON COLUMN "SPMS"."MOVEMENT_TYPE"."CREATE_TIME" IS '创建时间';
COMMENT ON COLUMN "SPMS"."MOVEMENT_TYPE"."UPDATE_TIME" IS '更新时间';
COMMENT ON TABLE "SPMS"."MOVEMENT_TYPE" IS '领用移动类型';

-- ----------------------------
-- Table structure for ORDER_COST_DEPT
-- ----------------------------
DROP TABLE "SPMS"."ORDER_COST_DEPT";
CREATE TABLE "SPMS"."ORDER_COST_DEPT" (
  "UUID" VARCHAR2(32 BYTE) VISIBLE NOT NULL,
  "DEPT_ID" NUMBER VISIBLE,
  "DEPT_NAME" VARCHAR2(255 BYTE) VISIBLE,
  "SUPERIOR_DEPT" NUMBER VISIBLE
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."ORDER_COST_DEPT"."UUID" IS 'UUID主键';
COMMENT ON COLUMN "SPMS"."ORDER_COST_DEPT"."DEPT_ID" IS '部门ID';
COMMENT ON COLUMN "SPMS"."ORDER_COST_DEPT"."DEPT_NAME" IS '部门名称';
COMMENT ON COLUMN "SPMS"."ORDER_COST_DEPT"."SUPERIOR_DEPT" IS '上级部门ID(0为根节点，负ID不可用)';
COMMENT ON TABLE "SPMS"."ORDER_COST_DEPT" IS '订单费用承担部门';

-- ----------------------------
-- Table structure for ORDER_KEY_VALUE_CONFIG
-- ----------------------------
DROP TABLE "SPMS"."ORDER_KEY_VALUE_CONFIG";
CREATE TABLE "SPMS"."ORDER_KEY_VALUE_CONFIG" (
  "UUID" VARCHAR2(32 BYTE) VISIBLE NOT NULL,
  "FIELD_KEY" VARCHAR2(32 BYTE) VISIBLE,
  "FIELD_NAME" VARCHAR2(64 BYTE) VISIBLE,
  "KEY_CODE" VARCHAR2(32 BYTE) VISIBLE,
  "KEY_CODE_DESC" VARCHAR2(64 BYTE) VISIBLE,
  "KEY_CODE_EN_DESC" VARCHAR2(64 BYTE) VISIBLE,
  "ENABLED" VARCHAR2(8 BYTE) VISIBLE,
  "SORT_NO" NUMBER VISIBLE,
  "REMARK" VARCHAR2(256 BYTE) VISIBLE
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."ORDER_KEY_VALUE_CONFIG"."UUID" IS '唯一UUID';
COMMENT ON COLUMN "SPMS"."ORDER_KEY_VALUE_CONFIG"."FIELD_KEY" IS '码值对照字段';
COMMENT ON COLUMN "SPMS"."ORDER_KEY_VALUE_CONFIG"."FIELD_NAME" IS '码值对照字段名称';
COMMENT ON COLUMN "SPMS"."ORDER_KEY_VALUE_CONFIG"."KEY_CODE" IS '码值对照代码';
COMMENT ON COLUMN "SPMS"."ORDER_KEY_VALUE_CONFIG"."KEY_CODE_DESC" IS '码值对照代码描述';
COMMENT ON COLUMN "SPMS"."ORDER_KEY_VALUE_CONFIG"."KEY_CODE_EN_DESC" IS '码值对照代码英文描述';
COMMENT ON COLUMN "SPMS"."ORDER_KEY_VALUE_CONFIG"."ENABLED" IS '是否启用（1启用，默认1；0停用；）';
COMMENT ON COLUMN "SPMS"."ORDER_KEY_VALUE_CONFIG"."SORT_NO" IS '排序号';
COMMENT ON COLUMN "SPMS"."ORDER_KEY_VALUE_CONFIG"."REMARK" IS '备注信息';
COMMENT ON TABLE "SPMS"."ORDER_KEY_VALUE_CONFIG" IS '订单请购码值配置信息表';

-- ----------------------------
-- Table structure for ORDER_LOG
-- ----------------------------
DROP TABLE "SPMS"."ORDER_LOG";
CREATE TABLE "SPMS"."ORDER_LOG" (
  "WORK_CODE" VARCHAR2(64 BYTE) VISIBLE,
  "COMMENTS" VARCHAR2(1024 BYTE) VISIBLE,
  "CREATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss'),
  "UUID" VARCHAR2(32 BYTE) VISIBLE,
  "LOG_AUTO_ID" NUMBER VISIBLE
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."ORDER_LOG"."WORK_CODE" IS '用户工号';
COMMENT ON COLUMN "SPMS"."ORDER_LOG"."COMMENTS" IS '审批意见/操作内容';
COMMENT ON COLUMN "SPMS"."ORDER_LOG"."CREATE_TIME" IS '创建时间';
COMMENT ON COLUMN "SPMS"."ORDER_LOG"."UUID" IS 'UUID关联，用于关联（车间/工厂）请购单表UUID获取请购单号';
COMMENT ON COLUMN "SPMS"."ORDER_LOG"."LOG_AUTO_ID" IS '日志信息自增ID';
COMMENT ON TABLE "SPMS"."ORDER_LOG" IS '订单审批记录表';

-- ----------------------------
-- Table structure for ORDER_WERKS
-- ----------------------------
DROP TABLE "SPMS"."ORDER_WERKS";
CREATE TABLE "SPMS"."ORDER_WERKS" (
  "SPMS_ID" VARCHAR2(64 BYTE) VISIBLE NOT NULL,
  "URGENCY" VARCHAR2(32 BYTE) VISIBLE,
  "APPLICATION_DATE" VARCHAR2(64 BYTE) VISIBLE,
  "DATE_REQUIRED" VARCHAR2(128 BYTE) VISIBLE,
  "SUBJECT" VARCHAR2(128 BYTE) VISIBLE,
  "STATUS" VARCHAR2(64 BYTE) VISIBLE,
  "WORK_CODE" VARCHAR2(64 BYTE) VISIBLE,
  "LAST_NAME" VARCHAR2(64 BYTE) VISIBLE,
  "WERKS" VARCHAR2(128 BYTE) VISIBLE,
  "WORKSHOP_CODE" VARCHAR2(128 BYTE) VISIBLE,
  "DEPT_ID" VARCHAR2(128 BYTE) VISIBLE,
  "POSITION_ID" VARCHAR2(128 BYTE) VISIBLE,
  "COMPANY" VARCHAR2(128 BYTE) VISIBLE,
  "BRANCH_POINT" VARCHAR2(128 BYTE) VISIBLE,
  "BRANCH_LINE" VARCHAR2(128 BYTE) VISIBLE,
  "PURCHASE_LOCATION" VARCHAR2(32 BYTE) VISIBLE,
  "JUSTIFICATION" VARCHAR2(1024 BYTE) VISIBLE,
  "PROJECT_CODE" VARCHAR2(64 BYTE) VISIBLE,
  "ESTIMATE_COST" NUMBER(15,3) VISIBLE,
  "PROJECT_TYPE" VARCHAR2(128 BYTE) VISIBLE,
  "PROJECT_STATUS" VARCHAR2(128 BYTE) VISIBLE,
  "PROJECT_CATEGORY" VARCHAR2(128 BYTE) VISIBLE,
  "SHIPPING_TYPE" VARCHAR2(32 BYTE) VISIBLE,
  "SHIPPING_FANGSHI" VARCHAR2(32 BYTE) VISIBLE,
  "APPLICATION_TYPE" VARCHAR2(128 BYTE) VISIBLE,
  "DEVICE_CATEGORY" VARCHAR2(128 BYTE) VISIBLE,
  "DEVICE_TYPE" VARCHAR2(32 BYTE) VISIBLE,
  "MATERIAL_CATEGORY" VARCHAR2(128 BYTE) VISIBLE,
  "APPROVAL_COMMENTS" VARCHAR2(1024 BYTE) VISIBLE,
  "OA_ID" VARCHAR2(64 BYTE) VISIBLE,
  "OA_PROCESS_ID" VARCHAR2(64 BYTE) VISIBLE,
  "OA_APPROVAL_DATE" VARCHAR2(64 BYTE) VISIBLE,
  "FIELD_FOR_OA" VARCHAR2(128 BYTE) VISIBLE,
  "DETAIL_EXPLAIN" VARCHAR2(1024 BYTE) VISIBLE,
  "RELEVANT_PROCESS" VARCHAR2(1024 BYTE) VISIBLE,
  "RELEVANT_DOCUMENT" VARCHAR2(1024 BYTE) VISIBLE,
  "PURCHASE_MANAGER" VARCHAR2(128 BYTE) VISIBLE,
  "COST_DEPT_ID" VARCHAR2(128 BYTE) VISIBLE,
  "COST_DEPT_NAME" VARCHAR2(128 BYTE) VISIBLE,
  "DEVICE_STATEMENT" VARCHAR2(1024 BYTE) VISIBLE,
  "DEVICE_ATTACHMENT" VARCHAR2(1024 BYTE) VISIBLE,
  "COMMENTS" VARCHAR2(1024 BYTE) VISIBLE,
  "OA_BIANHAO" VARCHAR2(128 BYTE) VISIBLE,
  "RELEVANT_DEPARTMENT" VARCHAR2(128 BYTE) VISIBLE,
  "ATTACHMENT_LIST" VARCHAR2(1024 BYTE) VISIBLE,
  "CREATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss'),
  "UUID" VARCHAR2(32 BYTE) VISIBLE
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."ORDER_WERKS"."SPMS_ID" IS '工厂请购单号';
COMMENT ON COLUMN "SPMS"."ORDER_WERKS"."URGENCY" IS '紧急程度，0正常；1重要；2紧急';
COMMENT ON COLUMN "SPMS"."ORDER_WERKS"."APPLICATION_DATE" IS '申请日期';
COMMENT ON COLUMN "SPMS"."ORDER_WERKS"."DATE_REQUIRED" IS '要求到货日期';
COMMENT ON COLUMN "SPMS"."ORDER_WERKS"."SUBJECT" IS '标题';
COMMENT ON COLUMN "SPMS"."ORDER_WERKS"."STATUS" IS '请购单SPMS状态-0关闭；1机电保存；2机电提交OA成功；3OA审批通过；4OA审批不通过；5提交SRM；6机电提交OA失败；7重新提交OA；8提交SRM失败；';
COMMENT ON COLUMN "SPMS"."ORDER_WERKS"."WORK_CODE" IS '工号';
COMMENT ON COLUMN "SPMS"."ORDER_WERKS"."LAST_NAME" IS '申请人';
COMMENT ON COLUMN "SPMS"."ORDER_WERKS"."WERKS" IS '工厂代码';
COMMENT ON COLUMN "SPMS"."ORDER_WERKS"."WORKSHOP_CODE" IS '车间代码';
COMMENT ON COLUMN "SPMS"."ORDER_WERKS"."DEPT_ID" IS '部门';
COMMENT ON COLUMN "SPMS"."ORDER_WERKS"."POSITION_ID" IS '岗位';
COMMENT ON COLUMN "SPMS"."ORDER_WERKS"."COMPANY" IS '分公司';
COMMENT ON COLUMN "SPMS"."ORDER_WERKS"."BRANCH_POINT" IS '分点';
COMMENT ON COLUMN "SPMS"."ORDER_WERKS"."BRANCH_LINE" IS '分线';
COMMENT ON COLUMN "SPMS"."ORDER_WERKS"."PURCHASE_LOCATION" IS '采购地点,1国内/中国，2海外/其他';
COMMENT ON COLUMN "SPMS"."ORDER_WERKS"."JUSTIFICATION" IS '申请原因';
COMMENT ON COLUMN "SPMS"."ORDER_WERKS"."PROJECT_CODE" IS '项目号';
COMMENT ON COLUMN "SPMS"."ORDER_WERKS"."ESTIMATE_COST" IS '预计费用合计';
COMMENT ON COLUMN "SPMS"."ORDER_WERKS"."PROJECT_TYPE" IS '项目类型,0-洗衣粉厂 1-五金加工厂 2-磁砖厂 3-肯尼亚砖厂 4-加纳砖厂 5-坦桑砖厂 6-科特五金厂 7-坦桑制钉厂 8-塞内加尔项目组 9-纸尿裤厂 10-加纳后山项目 11-分公司贸易 12-莫桑比克砖厂 13-赞比亚陶瓷厂';
COMMENT ON COLUMN "SPMS"."ORDER_WERKS"."PROJECT_STATUS" IS '项目状态，0已投产；1未投产';
COMMENT ON COLUMN "SPMS"."ORDER_WERKS"."PROJECT_CATEGORY" IS '项目类别';
COMMENT ON COLUMN "SPMS"."ORDER_WERKS"."SHIPPING_TYPE" IS '是否海运,0是，1否';
COMMENT ON COLUMN "SPMS"."ORDER_WERKS"."SHIPPING_FANGSHI" IS '运输方式, 0海运；1空运；2人带';
COMMENT ON COLUMN "SPMS"."ORDER_WERKS"."APPLICATION_TYPE" IS '申请类别，0临时采购，1月度；2季度；3年度';
COMMENT ON COLUMN "SPMS"."ORDER_WERKS"."DEVICE_CATEGORY" IS '设备/物料类别，3备品备件；4行政物资；5工厂设备；6筹建物资';
COMMENT ON COLUMN "SPMS"."ORDER_WERKS"."DEVICE_TYPE" IS '设备类型,0实验室设备；生产设备';
COMMENT ON COLUMN "SPMS"."ORDER_WERKS"."MATERIAL_CATEGORY" IS '物料类别';
COMMENT ON COLUMN "SPMS"."ORDER_WERKS"."APPROVAL_COMMENTS" IS '签字意见';
COMMENT ON COLUMN "SPMS"."ORDER_WERKS"."OA_ID" IS '员工OA编号';
COMMENT ON COLUMN "SPMS"."ORDER_WERKS"."OA_PROCESS_ID" IS 'OA工作流ID：0703，1201，3601';
COMMENT ON COLUMN "SPMS"."ORDER_WERKS"."OA_APPROVAL_DATE" IS '请购单OA审批通过日期';
COMMENT ON COLUMN "SPMS"."ORDER_WERKS"."FIELD_FOR_OA" IS '内部订单号';
COMMENT ON COLUMN "SPMS"."ORDER_WERKS"."DETAIL_EXPLAIN" IS '详细情况说明';
COMMENT ON COLUMN "SPMS"."ORDER_WERKS"."RELEVANT_PROCESS" IS '相关流程';
COMMENT ON COLUMN "SPMS"."ORDER_WERKS"."RELEVANT_DOCUMENT" IS '相关附件';
COMMENT ON COLUMN "SPMS"."ORDER_WERKS"."PURCHASE_MANAGER" IS '采购经理';
COMMENT ON COLUMN "SPMS"."ORDER_WERKS"."COST_DEPT_ID" IS '费用承担部门ID';
COMMENT ON COLUMN "SPMS"."ORDER_WERKS"."COST_DEPT_NAME" IS '费用承担部门NAME';
COMMENT ON COLUMN "SPMS"."ORDER_WERKS"."DEVICE_STATEMENT" IS '设备清单说明';
COMMENT ON COLUMN "SPMS"."ORDER_WERKS"."DEVICE_ATTACHMENT" IS '设备清单附件';
COMMENT ON COLUMN "SPMS"."ORDER_WERKS"."COMMENTS" IS '备注说明';
COMMENT ON COLUMN "SPMS"."ORDER_WERKS"."OA_BIANHAO" IS '编号';
COMMENT ON COLUMN "SPMS"."ORDER_WERKS"."RELEVANT_DEPARTMENT" IS '工厂关联部门';
COMMENT ON COLUMN "SPMS"."ORDER_WERKS"."ATTACHMENT_LIST" IS '附件清单';
COMMENT ON COLUMN "SPMS"."ORDER_WERKS"."CREATE_TIME" IS '单据创建系统时间戳';
COMMENT ON COLUMN "SPMS"."ORDER_WERKS"."UUID" IS 'java生成唯一ID，用于关联工厂请购单明细表';
COMMENT ON TABLE "SPMS"."ORDER_WERKS" IS '工厂请购单';

-- ----------------------------
-- Table structure for ORDER_WERKS_DTL
-- ----------------------------
DROP TABLE "SPMS"."ORDER_WERKS_DTL";
CREATE TABLE "SPMS"."ORDER_WERKS_DTL" (
  "SPMS_ID" VARCHAR2(64 BYTE) VISIBLE,
  "ROW_ID_WERKS" NUMBER VISIBLE,
  "SPMS_WS_ID" VARCHAR2(64 BYTE) VISIBLE,
  "ROW_ID_WS" NUMBER VISIBLE,
  "UUID" VARCHAR2(32 BYTE) VISIBLE
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."ORDER_WERKS_DTL"."SPMS_ID" IS '工厂请购单号';
COMMENT ON COLUMN "SPMS"."ORDER_WERKS_DTL"."ROW_ID_WERKS" IS '工厂请购单行号';
COMMENT ON COLUMN "SPMS"."ORDER_WERKS_DTL"."SPMS_WS_ID" IS '车间请购单号';
COMMENT ON COLUMN "SPMS"."ORDER_WERKS_DTL"."ROW_ID_WS" IS '车间请购单行号';
COMMENT ON COLUMN "SPMS"."ORDER_WERKS_DTL"."UUID" IS 'java生成唯一ID，用于关联工厂请购单表。新增数据时关联获取工厂请购单编号。';
COMMENT ON TABLE "SPMS"."ORDER_WERKS_DTL" IS '工厂请购单详情关联表';

-- ----------------------------
-- Table structure for ORDER_WORKSHOP
-- ----------------------------
DROP TABLE "SPMS"."ORDER_WORKSHOP";
CREATE TABLE "SPMS"."ORDER_WORKSHOP" (
  "UUID" VARCHAR2(32 BYTE) VISIBLE,
  "SPMS_WS_ID" VARCHAR2(64 BYTE) VISIBLE NOT NULL,
  "URGENCY" VARCHAR2(32 BYTE) VISIBLE,
  "APPLICATION_DATE" VARCHAR2(64 BYTE) VISIBLE,
  "DATE_REQUIRED" VARCHAR2(128 BYTE) VISIBLE,
  "SUBJECT" VARCHAR2(128 BYTE) VISIBLE,
  "WORK_CODE" VARCHAR2(64 BYTE) VISIBLE,
  "LAST_NAME" VARCHAR2(64 BYTE) VISIBLE,
  "WERKS" VARCHAR2(6 BYTE) VISIBLE,
  "WORKSHOP_CODE" VARCHAR2(128 BYTE) VISIBLE,
  "JUSTIFICATION" VARCHAR2(2000 BYTE) VISIBLE,
  "PROJECT_CODE" VARCHAR2(64 BYTE) VISIBLE,
  "PROJECT_TYPE" VARCHAR2(128 BYTE) VISIBLE,
  "PROJECT_STATUS" VARCHAR2(128 BYTE) VISIBLE,
  "STATUS" VARCHAR2(64 BYTE) VISIBLE,
  "CREATE_DATE" VARCHAR2(16 BYTE) VISIBLE,
  "UPDATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss'),
  "CREATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss'),
  "PURCHASE_LOCATION" VARCHAR2(32 BYTE) VISIBLE
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."ORDER_WORKSHOP"."UUID" IS 'java生成唯一ID，用于关联请购单明细表';
COMMENT ON COLUMN "SPMS"."ORDER_WORKSHOP"."SPMS_WS_ID" IS '车间请购单号';
COMMENT ON COLUMN "SPMS"."ORDER_WORKSHOP"."URGENCY" IS '紧急程度';
COMMENT ON COLUMN "SPMS"."ORDER_WORKSHOP"."APPLICATION_DATE" IS '提交日期';
COMMENT ON COLUMN "SPMS"."ORDER_WORKSHOP"."DATE_REQUIRED" IS '要求到货日期';
COMMENT ON COLUMN "SPMS"."ORDER_WORKSHOP"."SUBJECT" IS '标题';
COMMENT ON COLUMN "SPMS"."ORDER_WORKSHOP"."WORK_CODE" IS '员工工号';
COMMENT ON COLUMN "SPMS"."ORDER_WORKSHOP"."LAST_NAME" IS '员工姓名';
COMMENT ON COLUMN "SPMS"."ORDER_WORKSHOP"."WERKS" IS '工厂代码，必输字段';
COMMENT ON COLUMN "SPMS"."ORDER_WORKSHOP"."WORKSHOP_CODE" IS '车间编号';
COMMENT ON COLUMN "SPMS"."ORDER_WORKSHOP"."JUSTIFICATION" IS '申请原因';
COMMENT ON COLUMN "SPMS"."ORDER_WORKSHOP"."PROJECT_CODE" IS '项目号';
COMMENT ON COLUMN "SPMS"."ORDER_WORKSHOP"."PROJECT_TYPE" IS '项目类型,0-洗衣粉厂 1-五金加工厂 2-磁砖厂 3-肯尼亚砖厂 4-加纳砖厂 5-坦桑砖厂 6-科特五金厂 7-坦桑制钉厂 8-塞内加尔项目组 9-纸尿裤厂 10-加纳后山项目 11-分公司贸易 12-莫桑比克砖厂 13-赞比亚陶瓷厂';
COMMENT ON COLUMN "SPMS"."ORDER_WORKSHOP"."PROJECT_STATUS" IS '项目状态，0已投产；1未投产';
COMMENT ON COLUMN "SPMS"."ORDER_WORKSHOP"."STATUS" IS '车间请购单SPMS状态(0删除;1保存;2已提交;3审批不通过;4审批通过提交OA;)';
COMMENT ON COLUMN "SPMS"."ORDER_WORKSHOP"."CREATE_DATE" IS '创建日期，前端传入格式:yyyy-mm-dd';
COMMENT ON COLUMN "SPMS"."ORDER_WORKSHOP"."UPDATE_TIME" IS '单据更新系统时间戳，自动生成';
COMMENT ON COLUMN "SPMS"."ORDER_WORKSHOP"."CREATE_TIME" IS '单据创建系统时间戳,自动生成';
COMMENT ON COLUMN "SPMS"."ORDER_WORKSHOP"."PURCHASE_LOCATION" IS '采购地点';
COMMENT ON TABLE "SPMS"."ORDER_WORKSHOP" IS '车间请购单';

-- ----------------------------
-- Table structure for ORDER_WORKSHOP_DTL
-- ----------------------------
DROP TABLE "SPMS"."ORDER_WORKSHOP_DTL";
CREATE TABLE "SPMS"."ORDER_WORKSHOP_DTL" (
  "UUID" VARCHAR2(32 BYTE) VISIBLE,
  "SPMS_WS_ID" VARCHAR2(64 BYTE) VISIBLE,
  "ROW_ID" NUMBER VISIBLE,
  "MATERIAL_NO" VARCHAR2(128 BYTE) VISIBLE,
  "MATERIAL_ZH_DESC" VARCHAR2(256 BYTE) VISIBLE,
  "MATERIAL_EN_DESC" VARCHAR2(256 BYTE) VISIBLE,
  "REQUEST_QTY" NUMBER VISIBLE,
  "APPROVAL_QTY" NUMBER VISIBLE,
  "BASIC_UNIT" VARCHAR2(128 BYTE) VISIBLE,
  "BRAND" VARCHAR2(128 BYTE) VISIBLE,
  "ROW_STATUS" VARCHAR2(32 BYTE) VISIBLE,
  "ROW_COMMENT" VARCHAR2(1024 BYTE) VISIBLE,
  "DEVICE_ID" VARCHAR2(128 BYTE) VISIBLE,
  "DEVICE_CATEGORY" VARCHAR2(128 BYTE) VISIBLE,
  "DEVICE_TYPE" VARCHAR2(32 BYTE) VISIBLE,
  "MATERIAL_CATEGORY" VARCHAR2(128 BYTE) VISIBLE,
  "LONG_CONTRACT_CODE" VARCHAR2(128 BYTE) VISIBLE
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."ORDER_WORKSHOP_DTL"."UUID" IS 'java生成唯一ID，用于和车间请购单表关联。新增数据时关联获取车间请购单号。';
COMMENT ON COLUMN "SPMS"."ORDER_WORKSHOP_DTL"."SPMS_WS_ID" IS '车间请购单号';
COMMENT ON COLUMN "SPMS"."ORDER_WORKSHOP_DTL"."ROW_ID" IS '车间请购单行号';
COMMENT ON COLUMN "SPMS"."ORDER_WORKSHOP_DTL"."MATERIAL_NO" IS '物料编号';
COMMENT ON COLUMN "SPMS"."ORDER_WORKSHOP_DTL"."MATERIAL_ZH_DESC" IS '物料描述中文';
COMMENT ON COLUMN "SPMS"."ORDER_WORKSHOP_DTL"."MATERIAL_EN_DESC" IS '物料描述英文';
COMMENT ON COLUMN "SPMS"."ORDER_WORKSHOP_DTL"."REQUEST_QTY" IS '提交数量（车间主任）';
COMMENT ON COLUMN "SPMS"."ORDER_WORKSHOP_DTL"."APPROVAL_QTY" IS '批准数量（机电主任）';
COMMENT ON COLUMN "SPMS"."ORDER_WORKSHOP_DTL"."BASIC_UNIT" IS '基本单位';
COMMENT ON COLUMN "SPMS"."ORDER_WORKSHOP_DTL"."BRAND" IS '品牌';
COMMENT ON COLUMN "SPMS"."ORDER_WORKSHOP_DTL"."ROW_STATUS" IS '行项目状态';
COMMENT ON COLUMN "SPMS"."ORDER_WORKSHOP_DTL"."ROW_COMMENT" IS '行项目备注';
COMMENT ON COLUMN "SPMS"."ORDER_WORKSHOP_DTL"."DEVICE_ID" IS '需求匹配的设备编码';
COMMENT ON COLUMN "SPMS"."ORDER_WORKSHOP_DTL"."DEVICE_CATEGORY" IS '设备/物料类别，3备品备件；4行政物资；5工厂设备；6筹建物资';
COMMENT ON COLUMN "SPMS"."ORDER_WORKSHOP_DTL"."DEVICE_TYPE" IS '设备类型,0实验室设备；生产设备';
COMMENT ON COLUMN "SPMS"."ORDER_WORKSHOP_DTL"."MATERIAL_CATEGORY" IS '物料类别';
COMMENT ON COLUMN "SPMS"."ORDER_WORKSHOP_DTL"."LONG_CONTRACT_CODE" IS '长协编号';
COMMENT ON TABLE "SPMS"."ORDER_WORKSHOP_DTL" IS '车间请购单详情表';

-- ----------------------------
-- Table structure for OVERSEA_DELIVERY_NOTE
-- ----------------------------
DROP TABLE "SPMS"."OVERSEA_DELIVERY_NOTE";
CREATE TABLE "SPMS"."OVERSEA_DELIVERY_NOTE" (
  "UUID_DELIVERY_NOTE" VARCHAR2(32 BYTE) VISIBLE NOT NULL,
  "SAP_DELIVERY_NOTE" VARCHAR2(16 BYTE) VISIBLE,
  "SAP_PACKAGE_LIST" VARCHAR2(16 BYTE) VISIBLE,
  "CABINET_NUMBER" VARCHAR2(20 BYTE) VISIBLE,
  "DELIVERY_TYPE" VARCHAR2(8 BYTE) VISIBLE,
  "SPMS_STATUS" VARCHAR2(2 BYTE) VISIBLE DEFAULT '0',
  "WERKS_RECEIVE" VARCHAR2(8 BYTE) VISIBLE,
  "WERKS_DELIVERY" VARCHAR2(8 BYTE) VISIBLE,
  "CREATE_DATE" VARCHAR2(12 BYTE) VISIBLE,
  "ARRIVAL_DATE" VARCHAR2(16 BYTE) VISIBLE,
  "REMARKS" VARCHAR2(255 BYTE) VISIBLE,
  "COMMENTS" VARCHAR2(255 BYTE) VISIBLE,
  "POSTING_DATE" VARCHAR2(16 BYTE) VISIBLE,
  "SAP_VOUCHER_NUMBER" VARCHAR2(32 BYTE) VISIBLE,
  "SAP_VOUCHER_YEAR" VARCHAR2(8 BYTE) VISIBLE,
  "CANCEL_POSTING_DATE" VARCHAR2(16 BYTE) VISIBLE,
  "CANCEL_VOUCHER_NUMBER" VARCHAR2(32 BYTE) VISIBLE,
  "CANCEL_VOUCHER_YEAR" VARCHAR2(8 BYTE) VISIBLE,
  "SAP_REMARK" VARCHAR2(255 BYTE) VISIBLE,
  "DATA_STATUS" VARCHAR2(2 BYTE) VISIBLE DEFAULT '0',
  "DATA_VERSION" NUMBER VISIBLE DEFAULT "SPMS"."DATA_VERSION"."NEXTVAL",
  "CREATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss'),
  "UPDATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss'),
  "ACTUAL_WERKS_RECEIVE" VARCHAR2(6 BYTE) VISIBLE,
  "OA_WORKFLOW" VARCHAR2(16 BYTE) VISIBLE,
  "OA_BIANHAO" VARCHAR2(32 BYTE) VISIBLE,
  "OA_REMARK" VARCHAR2(255 BYTE) VISIBLE,
  "SUBMIT_OA_DATE" VARCHAR2(12 BYTE) VISIBLE,
  "OA_APPROVAL_DATE" VARCHAR2(12 BYTE) VISIBLE,
  "OA_FIELD" VARCHAR2(16 BYTE) VISIBLE,
  "UNDER_VOUCHER_NUMBER" VARCHAR2(32 BYTE) VISIBLE,
  "UNDER_VOUCHER_YEAR" VARCHAR2(8 BYTE) VISIBLE,
  "UNDER_POSTING_DATE" VARCHAR2(16 BYTE) VISIBLE,
  "CANCEL_UNDER_POSTING_DATE" VARCHAR2(16 BYTE) VISIBLE,
  "CANCEL_UNDER_VOUCHER_NUMBER" VARCHAR2(32 BYTE) VISIBLE,
  "CANCEL_UNDER_VOUCHER_YEAR" VARCHAR2(8 BYTE) VISIBLE,
  "ACTUAL_WHS_LOCATION_CODE_RECEIVE" VARCHAR2(12 BYTE) VISIBLE,
  "COST_CENTER" VARCHAR2(32 BYTE) VISIBLE
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."OVERSEA_DELIVERY_NOTE"."UUID_DELIVERY_NOTE" IS '交货单号uuid';
COMMENT ON COLUMN "SPMS"."OVERSEA_DELIVERY_NOTE"."SAP_DELIVERY_NOTE" IS '交货单号';
COMMENT ON COLUMN "SPMS"."OVERSEA_DELIVERY_NOTE"."SAP_PACKAGE_LIST" IS '装箱单号';
COMMENT ON COLUMN "SPMS"."OVERSEA_DELIVERY_NOTE"."CABINET_NUMBER" IS '货柜号';
COMMENT ON COLUMN "SPMS"."OVERSEA_DELIVERY_NOTE"."DELIVERY_TYPE" IS '交货类型';
COMMENT ON COLUMN "SPMS"."OVERSEA_DELIVERY_NOTE"."SPMS_STATUS" IS 'SPMS收货单据状态(默认0待到货;1收货中/SAP凭证撤销;2入库完成/提交OA成功;3提交OA失败;4OA审批不通过;5OA审批通过/提交SAP失败;6收货多收提交SAP失败;7收货多收提交SAP成功;8收货少收提交SAP失败;9收货少收提交SAP成功;10提交SAP完成;11收货完成;12关闭/废单;)';
COMMENT ON COLUMN "SPMS"."OVERSEA_DELIVERY_NOTE"."WERKS_RECEIVE" IS '收货工厂';
COMMENT ON COLUMN "SPMS"."OVERSEA_DELIVERY_NOTE"."WERKS_DELIVERY" IS '发货工厂';
COMMENT ON COLUMN "SPMS"."OVERSEA_DELIVERY_NOTE"."CREATE_DATE" IS '创建日期';
COMMENT ON COLUMN "SPMS"."OVERSEA_DELIVERY_NOTE"."ARRIVAL_DATE" IS '到货日期(第一次生成入库任务日期)';
COMMENT ON COLUMN "SPMS"."OVERSEA_DELIVERY_NOTE"."REMARKS" IS 'SPMS备注信息';
COMMENT ON COLUMN "SPMS"."OVERSEA_DELIVERY_NOTE"."COMMENTS" IS 'SPMS评论/预留';
COMMENT ON COLUMN "SPMS"."OVERSEA_DELIVERY_NOTE"."POSTING_DATE" IS '过账日期/少收提交SAP入库凭证';
COMMENT ON COLUMN "SPMS"."OVERSEA_DELIVERY_NOTE"."SAP_VOUCHER_NUMBER" IS 'SAP凭证号/少收提交SAP入库凭证';
COMMENT ON COLUMN "SPMS"."OVERSEA_DELIVERY_NOTE"."SAP_VOUCHER_YEAR" IS 'SAP凭证年份/少收提交SAP入库凭证';
COMMENT ON COLUMN "SPMS"."OVERSEA_DELIVERY_NOTE"."CANCEL_POSTING_DATE" IS '撤销SAP过账日期/少收提交SAP入库凭证';
COMMENT ON COLUMN "SPMS"."OVERSEA_DELIVERY_NOTE"."CANCEL_VOUCHER_NUMBER" IS '撤销SAP凭证/少收提交SAP入库凭证';
COMMENT ON COLUMN "SPMS"."OVERSEA_DELIVERY_NOTE"."CANCEL_VOUCHER_YEAR" IS '撤销SAP凭证年份/少收提交SAP入库凭证';
COMMENT ON COLUMN "SPMS"."OVERSEA_DELIVERY_NOTE"."SAP_REMARK" IS 'SAP交货单抬头文本';
COMMENT ON COLUMN "SPMS"."OVERSEA_DELIVERY_NOTE"."DATA_STATUS" IS '数据状态(默认0能被SAP更新数据；1禁止更新数据；)';
COMMENT ON COLUMN "SPMS"."OVERSEA_DELIVERY_NOTE"."DATA_VERSION" IS '数据版本号';
COMMENT ON COLUMN "SPMS"."OVERSEA_DELIVERY_NOTE"."CREATE_TIME" IS '创建时间';
COMMENT ON COLUMN "SPMS"."OVERSEA_DELIVERY_NOTE"."UPDATE_TIME" IS '更新时间';
COMMENT ON COLUMN "SPMS"."OVERSEA_DELIVERY_NOTE"."ACTUAL_WERKS_RECEIVE" IS '实际收货工厂(交货单分批收不允许跨工厂收货)';
COMMENT ON COLUMN "SPMS"."OVERSEA_DELIVERY_NOTE"."OA_WORKFLOW" IS 'OA流程编号';
COMMENT ON COLUMN "SPMS"."OVERSEA_DELIVERY_NOTE"."OA_BIANHAO" IS 'OA单据编号';
COMMENT ON COLUMN "SPMS"."OVERSEA_DELIVERY_NOTE"."OA_REMARK" IS '提交OA审批备注';
COMMENT ON COLUMN "SPMS"."OVERSEA_DELIVERY_NOTE"."SUBMIT_OA_DATE" IS '提交OA日期';
COMMENT ON COLUMN "SPMS"."OVERSEA_DELIVERY_NOTE"."OA_APPROVAL_DATE" IS 'OA审批通过日期';
COMMENT ON COLUMN "SPMS"."OVERSEA_DELIVERY_NOTE"."OA_FIELD" IS 'OA预留字段/存储SPMS生成提交OA流水单据号';
COMMENT ON COLUMN "SPMS"."OVERSEA_DELIVERY_NOTE"."UNDER_VOUCHER_NUMBER" IS 'SAP凭证号/少收凭证';
COMMENT ON COLUMN "SPMS"."OVERSEA_DELIVERY_NOTE"."UNDER_VOUCHER_YEAR" IS 'SAP凭证年份/少收凭证';
COMMENT ON COLUMN "SPMS"."OVERSEA_DELIVERY_NOTE"."UNDER_POSTING_DATE" IS '过账日期/少收凭证';
COMMENT ON COLUMN "SPMS"."OVERSEA_DELIVERY_NOTE"."CANCEL_UNDER_POSTING_DATE" IS '撤销SAP过账日期/少收凭证';
COMMENT ON COLUMN "SPMS"."OVERSEA_DELIVERY_NOTE"."CANCEL_UNDER_VOUCHER_NUMBER" IS '撤销SAP凭证/少收凭证';
COMMENT ON COLUMN "SPMS"."OVERSEA_DELIVERY_NOTE"."CANCEL_UNDER_VOUCHER_YEAR" IS '撤销SAP凭证年份/少收凭证';
COMMENT ON COLUMN "SPMS"."OVERSEA_DELIVERY_NOTE"."ACTUAL_WHS_LOCATION_CODE_RECEIVE" IS '实际收货仓库(第一次拆出入库任务时写入)';
COMMENT ON COLUMN "SPMS"."OVERSEA_DELIVERY_NOTE"."COST_CENTER" IS '成本中心';
COMMENT ON TABLE "SPMS"."OVERSEA_DELIVERY_NOTE" IS '海外仓交货单表';

-- ----------------------------
-- Table structure for OVERSEA_DELIVERY_NOTE_DTL
-- ----------------------------
DROP TABLE "SPMS"."OVERSEA_DELIVERY_NOTE_DTL";
CREATE TABLE "SPMS"."OVERSEA_DELIVERY_NOTE_DTL" (
  "AUTO_ID_DELIVERY_NOTE" NUMBER VISIBLE DEFAULT "SPMS"."OVERSEA_DELIVERY_NOTE_DTL_SEQ"."NEXTVAL" NOT NULL,
  "SAP_DELIVERY_NOTE" VARCHAR2(16 BYTE) VISIBLE,
  "SAP_DELIVERY_NOTE_ITEM" VARCHAR2(6 BYTE) VISIBLE,
  "MATERIAL_NO" VARCHAR2(32 BYTE) VISIBLE,
  "BASIC_UNIT" VARCHAR2(6 BYTE) VISIBLE,
  "UNIT_SALES" VARCHAR2(6 BYTE) VISIBLE,
  "RECEIVABLE_QTY_BASIC_UNIT" NUMBER VISIBLE DEFAULT 0,
  "RECEIVABLE_QTY_UNIT_SALES" NUMBER VISIBLE DEFAULT 0,
  "ACTUAL_QTY_BASIC_UNIT" NUMBER VISIBLE DEFAULT 0,
  "ACTUAL_QTY_UNIT_SALES" NUMBER VISIBLE DEFAULT 0,
  "PURCHASE_NO" VARCHAR2(16 BYTE) VISIBLE,
  "PURCHASE_NO_ITEM" VARCHAR2(6 BYTE) VISIBLE,
  "REMARKS" VARCHAR2(255 BYTE) VISIBLE,
  "WERKS_DELIVERY" VARCHAR2(6 BYTE) VISIBLE,
  "WHS_LOCATION_CODE_DELIVERY" VARCHAR2(8 BYTE) VISIBLE,
  "WERKS_RECEIVE" VARCHAR2(6 BYTE) VISIBLE,
  "WHS_LOCATION_CODE_RECEIVE" VARCHAR2(8 BYTE) VISIBLE,
  "OVERCHARGED_QTY_BASIC_UNIT" NUMBER VISIBLE DEFAULT 0,
  "OVERCHARGED_QTY_UNIT_SALES" NUMBER VISIBLE DEFAULT 0,
  "UNDERCHARGED_QTY_BASIC_UNIT" NUMBER VISIBLE DEFAULT 0,
  "UNDERCHARGED_QTY_UNIT_SALES" NUMBER VISIBLE DEFAULT 0,
  "MOVEMENT_TYPE" VARCHAR2(6 BYTE) VISIBLE,
  "SAP_REMARK" VARCHAR2(255 BYTE) VISIBLE,
  "COLOR_NO" VARCHAR2(64 BYTE) VISIBLE,
  "DATA_STATUS" VARCHAR2(2 BYTE) VISIBLE DEFAULT '0',
  "DATA_VERSION" NUMBER VISIBLE DEFAULT "SPMS"."DATA_VERSION"."NEXTVAL",
  "CREATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss'),
  "UPDATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss')
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."OVERSEA_DELIVERY_NOTE_DTL"."AUTO_ID_DELIVERY_NOTE" IS '交货单明细自增ID';
COMMENT ON COLUMN "SPMS"."OVERSEA_DELIVERY_NOTE_DTL"."SAP_DELIVERY_NOTE" IS '交货单号';
COMMENT ON COLUMN "SPMS"."OVERSEA_DELIVERY_NOTE_DTL"."SAP_DELIVERY_NOTE_ITEM" IS '交货单行号';
COMMENT ON COLUMN "SPMS"."OVERSEA_DELIVERY_NOTE_DTL"."MATERIAL_NO" IS '物料编号';
COMMENT ON COLUMN "SPMS"."OVERSEA_DELIVERY_NOTE_DTL"."BASIC_UNIT" IS '基本单位';
COMMENT ON COLUMN "SPMS"."OVERSEA_DELIVERY_NOTE_DTL"."UNIT_SALES" IS '销售单位';
COMMENT ON COLUMN "SPMS"."OVERSEA_DELIVERY_NOTE_DTL"."RECEIVABLE_QTY_BASIC_UNIT" IS '基本单位发货数量/海外应收基本单位数量';
COMMENT ON COLUMN "SPMS"."OVERSEA_DELIVERY_NOTE_DTL"."RECEIVABLE_QTY_UNIT_SALES" IS '销售单位发出的数量/海外应收销售单位数量';
COMMENT ON COLUMN "SPMS"."OVERSEA_DELIVERY_NOTE_DTL"."ACTUAL_QTY_BASIC_UNIT" IS '实收基本单位数量';
COMMENT ON COLUMN "SPMS"."OVERSEA_DELIVERY_NOTE_DTL"."ACTUAL_QTY_UNIT_SALES" IS '实收销售单位数量';
COMMENT ON COLUMN "SPMS"."OVERSEA_DELIVERY_NOTE_DTL"."PURCHASE_NO" IS '参考单据的单据编号/公司间采购订单号';
COMMENT ON COLUMN "SPMS"."OVERSEA_DELIVERY_NOTE_DTL"."PURCHASE_NO_ITEM" IS '参考项目的项目号/公司间采购订单行项目';
COMMENT ON COLUMN "SPMS"."OVERSEA_DELIVERY_NOTE_DTL"."REMARKS" IS 'SPMS备注信息';
COMMENT ON COLUMN "SPMS"."OVERSEA_DELIVERY_NOTE_DTL"."WERKS_DELIVERY" IS '发货工厂';
COMMENT ON COLUMN "SPMS"."OVERSEA_DELIVERY_NOTE_DTL"."WHS_LOCATION_CODE_DELIVERY" IS '发货库存地点';
COMMENT ON COLUMN "SPMS"."OVERSEA_DELIVERY_NOTE_DTL"."WERKS_RECEIVE" IS '收货工厂';
COMMENT ON COLUMN "SPMS"."OVERSEA_DELIVERY_NOTE_DTL"."WHS_LOCATION_CODE_RECEIVE" IS '收货库存地点';
COMMENT ON COLUMN "SPMS"."OVERSEA_DELIVERY_NOTE_DTL"."OVERCHARGED_QTY_BASIC_UNIT" IS '多收基本单位数量';
COMMENT ON COLUMN "SPMS"."OVERSEA_DELIVERY_NOTE_DTL"."OVERCHARGED_QTY_UNIT_SALES" IS '多收销售单位数量';
COMMENT ON COLUMN "SPMS"."OVERSEA_DELIVERY_NOTE_DTL"."UNDERCHARGED_QTY_BASIC_UNIT" IS '少收基本单位数量';
COMMENT ON COLUMN "SPMS"."OVERSEA_DELIVERY_NOTE_DTL"."UNDERCHARGED_QTY_UNIT_SALES" IS '少收销售单位数量';
COMMENT ON COLUMN "SPMS"."OVERSEA_DELIVERY_NOTE_DTL"."MOVEMENT_TYPE" IS '移动类型（库存管理）';
COMMENT ON COLUMN "SPMS"."OVERSEA_DELIVERY_NOTE_DTL"."SAP_REMARK" IS 'SAP交货单行备注';
COMMENT ON COLUMN "SPMS"."OVERSEA_DELIVERY_NOTE_DTL"."COLOR_NO" IS '色号批次';
COMMENT ON COLUMN "SPMS"."OVERSEA_DELIVERY_NOTE_DTL"."DATA_STATUS" IS '数据状态(默认0能被SAP更新数据；1禁止更新数据；)';
COMMENT ON COLUMN "SPMS"."OVERSEA_DELIVERY_NOTE_DTL"."DATA_VERSION" IS '数据版本号';
COMMENT ON COLUMN "SPMS"."OVERSEA_DELIVERY_NOTE_DTL"."CREATE_TIME" IS '创建时间';
COMMENT ON COLUMN "SPMS"."OVERSEA_DELIVERY_NOTE_DTL"."UPDATE_TIME" IS '更新时间';
COMMENT ON TABLE "SPMS"."OVERSEA_DELIVERY_NOTE_DTL" IS '海外仓交货单明细表';

-- ----------------------------
-- Table structure for OVERSEA_DN
-- ----------------------------
DROP TABLE "SPMS"."OVERSEA_DN";
CREATE TABLE "SPMS"."OVERSEA_DN" (
  "UUID_DELIVERY_NOTE" VARCHAR2(32 BYTE) VISIBLE NOT NULL,
  "SAP_DELIVERY_NOTE" VARCHAR2(16 BYTE) VISIBLE,
  "SPMS_STATUS" VARCHAR2(2 BYTE) VISIBLE DEFAULT '0',
  "WERKS_RECEIVE" VARCHAR2(8 BYTE) VISIBLE,
  "WHS_LOCATION_CODE_RECEIVE" VARCHAR2(6 BYTE) VISIBLE,
  "SAP_CREATE_DATE" VARCHAR2(16 BYTE) VISIBLE,
  "DELIVERY_DATE" VARCHAR2(16 BYTE) VISIBLE,
  "ARRIVAL_DATE" VARCHAR2(16 BYTE) VISIBLE,
  "REMARKS" VARCHAR2(255 BYTE) VISIBLE,
  "COMMENTS" VARCHAR2(255 BYTE) VISIBLE,
  "OPERATE_USER" VARCHAR2(64 BYTE) VISIBLE,
  "POSTING_DATE" VARCHAR2(16 BYTE) VISIBLE,
  "SAP_VOUCHER_NUMBER" VARCHAR2(32 BYTE) VISIBLE,
  "SAP_VOUCHER_YEAR" VARCHAR2(8 BYTE) VISIBLE,
  "CANCEL_POSTING_DATE" VARCHAR2(16 BYTE) VISIBLE,
  "CANCEL_VOUCHER_NUMBER" VARCHAR2(32 BYTE) VISIBLE,
  "CANCEL_VOUCHER_YEAR" VARCHAR2(8 BYTE) VISIBLE,
  "UNDER_VOUCHER_NUMBER" VARCHAR2(32 BYTE) VISIBLE,
  "UNDER_VOUCHER_YEAR" VARCHAR2(8 BYTE) VISIBLE,
  "UNDER_POSTING_DATE" VARCHAR2(16 BYTE) VISIBLE,
  "CANCEL_UNDER_POSTING_DATE" VARCHAR2(16 BYTE) VISIBLE,
  "CANCEL_UNDER_VOUCHER_NUMBER" VARCHAR2(32 BYTE) VISIBLE,
  "CANCEL_UNDER_VOUCHER_YEAR" VARCHAR2(8 BYTE) VISIBLE,
  "COST_CENTER" VARCHAR2(32 BYTE) VISIBLE,
  "DATA_STATUS" VARCHAR2(2 BYTE) VISIBLE DEFAULT '0',
  "DATA_VERSION" NUMBER VISIBLE DEFAULT "SPMS"."DATA_VERSION"."NEXTVAL",
  "CREATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss'),
  "UPDATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss'),
  "BUSINESS_TYPE" VARCHAR2(4 BYTE) VISIBLE
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."OVERSEA_DN"."UUID_DELIVERY_NOTE" IS '交货单号uuid';
COMMENT ON COLUMN "SPMS"."OVERSEA_DN"."SAP_DELIVERY_NOTE" IS '交货单号';
COMMENT ON COLUMN "SPMS"."OVERSEA_DN"."SPMS_STATUS" IS 'SPMS收货单据状态(默认0待到货;1入库中/审批不通过;2入库完成/待审批;3审批通过;4按应收提交SAP成功/SPMS按实收入库存;5按应收提交SAP失败;6收货少收提交SAP失败;7收货少收提交SAP成功;8提交SAP完成;9收货完成;10关闭/废单;)';
COMMENT ON COLUMN "SPMS"."OVERSEA_DN"."WERKS_RECEIVE" IS '收货工厂';
COMMENT ON COLUMN "SPMS"."OVERSEA_DN"."WHS_LOCATION_CODE_RECEIVE" IS '收货仓库地址';
COMMENT ON COLUMN "SPMS"."OVERSEA_DN"."SAP_CREATE_DATE" IS 'DN创建日期';
COMMENT ON COLUMN "SPMS"."OVERSEA_DN"."DELIVERY_DATE" IS 'SAP DN交货日期';
COMMENT ON COLUMN "SPMS"."OVERSEA_DN"."ARRIVAL_DATE" IS '到货日期(用户确认到货日期)';
COMMENT ON COLUMN "SPMS"."OVERSEA_DN"."REMARKS" IS 'SPMS备注信息';
COMMENT ON COLUMN "SPMS"."OVERSEA_DN"."COMMENTS" IS 'SPMS评论/预留';
COMMENT ON COLUMN "SPMS"."OVERSEA_DN"."OPERATE_USER" IS '操作员';
COMMENT ON COLUMN "SPMS"."OVERSEA_DN"."POSTING_DATE" IS '过账日期/按应收入库凭证';
COMMENT ON COLUMN "SPMS"."OVERSEA_DN"."SAP_VOUCHER_NUMBER" IS 'SAP凭证号/按应收入库凭证';
COMMENT ON COLUMN "SPMS"."OVERSEA_DN"."SAP_VOUCHER_YEAR" IS 'SAP凭证年份/按应收入库凭证';
COMMENT ON COLUMN "SPMS"."OVERSEA_DN"."CANCEL_POSTING_DATE" IS '撤销SAP过账日期/按应收入库凭证';
COMMENT ON COLUMN "SPMS"."OVERSEA_DN"."CANCEL_VOUCHER_NUMBER" IS '撤销SAP凭证/按应收入库凭证';
COMMENT ON COLUMN "SPMS"."OVERSEA_DN"."CANCEL_VOUCHER_YEAR" IS '撤销SAP凭证年份/按应收入库凭证';
COMMENT ON COLUMN "SPMS"."OVERSEA_DN"."UNDER_VOUCHER_NUMBER" IS 'SAP凭证号/少收凭证';
COMMENT ON COLUMN "SPMS"."OVERSEA_DN"."UNDER_VOUCHER_YEAR" IS 'SAP凭证年份/少收凭证';
COMMENT ON COLUMN "SPMS"."OVERSEA_DN"."UNDER_POSTING_DATE" IS 'SAP过账日期/少收凭证';
COMMENT ON COLUMN "SPMS"."OVERSEA_DN"."CANCEL_UNDER_POSTING_DATE" IS '撤销SAP过账日期/少收凭证';
COMMENT ON COLUMN "SPMS"."OVERSEA_DN"."CANCEL_UNDER_VOUCHER_NUMBER" IS '撤销SAP凭证/少收凭证';
COMMENT ON COLUMN "SPMS"."OVERSEA_DN"."CANCEL_UNDER_VOUCHER_YEAR" IS '撤销SAP凭证年份/少收凭证';
COMMENT ON COLUMN "SPMS"."OVERSEA_DN"."COST_CENTER" IS '成本中心';
COMMENT ON COLUMN "SPMS"."OVERSEA_DN"."DATA_STATUS" IS '数据状态(默认0能被SAP更新数据；1禁止更新数据；)';
COMMENT ON COLUMN "SPMS"."OVERSEA_DN"."DATA_VERSION" IS '数据版本号';
COMMENT ON COLUMN "SPMS"."OVERSEA_DN"."CREATE_TIME" IS '创建时间';
COMMENT ON COLUMN "SPMS"."OVERSEA_DN"."UPDATE_TIME" IS '更新时间';
COMMENT ON COLUMN "SPMS"."OVERSEA_DN"."BUSINESS_TYPE" IS '业务标识(01空运人带;02本地采购;03海外转储;05退货订单;)';
COMMENT ON TABLE "SPMS"."OVERSEA_DN" IS '海外仓交货单表(空运人带/转储/本地采购)';

-- ----------------------------
-- Table structure for OVERSEA_DN_DTL
-- ----------------------------
DROP TABLE "SPMS"."OVERSEA_DN_DTL";
CREATE TABLE "SPMS"."OVERSEA_DN_DTL" (
  "AUTO_ID_DN" NUMBER VISIBLE DEFAULT "SPMS"."OVERSEA_DN_DTL_SEQ"."NEXTVAL" NOT NULL,
  "SAP_DELIVERY_NOTE" VARCHAR2(16 BYTE) VISIBLE,
  "SAP_DELIVERY_NOTE_ITEM" VARCHAR2(6 BYTE) VISIBLE,
  "SAP_PURCHASE_ORDER" VARCHAR2(16 BYTE) VISIBLE,
  "SAP_PURCHASE_ORDER_ITEM" VARCHAR2(6 BYTE) VISIBLE,
  "WERKS_DELIVERY" VARCHAR2(6 BYTE) VISIBLE,
  "WHS_LOCATION_CODE_DELIVERY" VARCHAR2(6 BYTE) VISIBLE,
  "WERKS_RECEIVE" VARCHAR2(6 BYTE) VISIBLE,
  "WHS_LOCATION_CODE_RECEIVE" VARCHAR2(6 BYTE) VISIBLE,
  "MATERIAL_NO" VARCHAR2(32 BYTE) VISIBLE,
  "BASIC_UNIT" VARCHAR2(6 BYTE) VISIBLE,
  "UNIT_SALES" VARCHAR2(6 BYTE) VISIBLE,
  "RECEIVABLE_QTY_BASIC_UNIT" NUMBER VISIBLE DEFAULT 0,
  "RECEIVABLE_QTY_UNIT_SALES" NUMBER VISIBLE DEFAULT 0,
  "ACTUAL_QTY_BASIC_UNIT" NUMBER VISIBLE DEFAULT 0,
  "ACTUAL_QTY_UNIT_SALES" NUMBER VISIBLE DEFAULT 0,
  "STORAGE_INFO" VARCHAR2(2000 BYTE) VISIBLE,
  "REMARKS" VARCHAR2(255 BYTE) VISIBLE,
  "COMMENTS" VARCHAR2(255 BYTE) VISIBLE,
  "BOX_NOTE" VARCHAR2(32 BYTE) VISIBLE,
  "BOX_NOTE_ITEM" VARCHAR2(6 BYTE) VISIBLE,
  "DOMESTIC_ACTUAL_QTY" NUMBER VISIBLE DEFAULT 0,
  "DEMAND_NO" VARCHAR2(32 BYTE) VISIBLE,
  "DEMAND_ITEM" VARCHAR2(6 BYTE) VISIBLE,
  "DEMANDER" VARCHAR2(64 BYTE) VISIBLE,
  "DATA_STATUS" VARCHAR2(2 BYTE) VISIBLE DEFAULT '0',
  "DATA_VERSION" NUMBER VISIBLE DEFAULT "SPMS"."DATA_VERSION"."NEXTVAL",
  "CREATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss'),
  "UPDATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss')
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."OVERSEA_DN_DTL"."AUTO_ID_DN" IS '交货单明细表自增ID';
COMMENT ON COLUMN "SPMS"."OVERSEA_DN_DTL"."SAP_DELIVERY_NOTE" IS '交货单号';
COMMENT ON COLUMN "SPMS"."OVERSEA_DN_DTL"."SAP_DELIVERY_NOTE_ITEM" IS '交货单行号';
COMMENT ON COLUMN "SPMS"."OVERSEA_DN_DTL"."SAP_PURCHASE_ORDER" IS '参考采购凭证号PO';
COMMENT ON COLUMN "SPMS"."OVERSEA_DN_DTL"."SAP_PURCHASE_ORDER_ITEM" IS '参考采购凭证号PO行号';
COMMENT ON COLUMN "SPMS"."OVERSEA_DN_DTL"."WERKS_DELIVERY" IS '发货工厂';
COMMENT ON COLUMN "SPMS"."OVERSEA_DN_DTL"."WHS_LOCATION_CODE_DELIVERY" IS '发货仓库地址';
COMMENT ON COLUMN "SPMS"."OVERSEA_DN_DTL"."WERKS_RECEIVE" IS '收货工厂';
COMMENT ON COLUMN "SPMS"."OVERSEA_DN_DTL"."WHS_LOCATION_CODE_RECEIVE" IS '收货仓库地址';
COMMENT ON COLUMN "SPMS"."OVERSEA_DN_DTL"."MATERIAL_NO" IS '物料编号';
COMMENT ON COLUMN "SPMS"."OVERSEA_DN_DTL"."BASIC_UNIT" IS '基本单位';
COMMENT ON COLUMN "SPMS"."OVERSEA_DN_DTL"."UNIT_SALES" IS '销售单位';
COMMENT ON COLUMN "SPMS"."OVERSEA_DN_DTL"."RECEIVABLE_QTY_BASIC_UNIT" IS '交货数量/应收基本单位数量';
COMMENT ON COLUMN "SPMS"."OVERSEA_DN_DTL"."RECEIVABLE_QTY_UNIT_SALES" IS '交货数量/应收销售单位数量';
COMMENT ON COLUMN "SPMS"."OVERSEA_DN_DTL"."ACTUAL_QTY_BASIC_UNIT" IS '实收基本单位数量';
COMMENT ON COLUMN "SPMS"."OVERSEA_DN_DTL"."ACTUAL_QTY_UNIT_SALES" IS '实收销售单位数量';
COMMENT ON COLUMN "SPMS"."OVERSEA_DN_DTL"."STORAGE_INFO" IS '储位信息';
COMMENT ON COLUMN "SPMS"."OVERSEA_DN_DTL"."REMARKS" IS '行备注信息';
COMMENT ON COLUMN "SPMS"."OVERSEA_DN_DTL"."COMMENTS" IS '行评论信息/预留';
COMMENT ON COLUMN "SPMS"."OVERSEA_DN_DTL"."BOX_NOTE" IS '箱码';
COMMENT ON COLUMN "SPMS"."OVERSEA_DN_DTL"."BOX_NOTE_ITEM" IS '箱码行号(对应箱码明细表的ITEM字段)';
COMMENT ON COLUMN "SPMS"."OVERSEA_DN_DTL"."DOMESTIC_ACTUAL_QTY" IS '国内实际发货基本单位数量';
COMMENT ON COLUMN "SPMS"."OVERSEA_DN_DTL"."DEMAND_NO" IS 'SPMS需求来源号';
COMMENT ON COLUMN "SPMS"."OVERSEA_DN_DTL"."DEMAND_ITEM" IS 'SPMS需求来源行号';
COMMENT ON COLUMN "SPMS"."OVERSEA_DN_DTL"."DEMANDER" IS '需求申请人';
COMMENT ON COLUMN "SPMS"."OVERSEA_DN_DTL"."DATA_STATUS" IS '数据状态(默认0能被SAP更新数据；1禁止更新数据；)';
COMMENT ON COLUMN "SPMS"."OVERSEA_DN_DTL"."DATA_VERSION" IS '数据版本号';
COMMENT ON COLUMN "SPMS"."OVERSEA_DN_DTL"."CREATE_TIME" IS '创建时间';
COMMENT ON COLUMN "SPMS"."OVERSEA_DN_DTL"."UPDATE_TIME" IS '更新时间';
COMMENT ON TABLE "SPMS"."OVERSEA_DN_DTL" IS '交货单明细采购订单明细关系表';

-- ----------------------------
-- Table structure for OVERSEA_INV_CHECK
-- ----------------------------
DROP TABLE "SPMS"."OVERSEA_INV_CHECK";
CREATE TABLE "SPMS"."OVERSEA_INV_CHECK" (
  "UUID" VARCHAR2(32 BYTE) VISIBLE NOT NULL,
  "INVENTORY_CHECK_ID" VARCHAR2(32 BYTE) VISIBLE,
  "WERKS" VARCHAR2(6 BYTE) VISIBLE,
  "WHS_LOCATION_CODE" VARCHAR2(6 BYTE) VISIBLE,
  "INVENTORY_CHECK_TYPE" VARCHAR2(2 BYTE) VISIBLE,
  "INVENTORY_CHECK_CATEGORY" VARCHAR2(2 BYTE) VISIBLE,
  "INVENTORY_CHECK_MOLD" VARCHAR2(2 BYTE) VISIBLE,
  "INVENTORY_CHECK_DATE" VARCHAR2(16 BYTE) VISIBLE,
  "INVENTORY_CHECK_RESULT" VARCHAR2(2 BYTE) VISIBLE,
  "IS_REVIEW" VARCHAR2(2 BYTE) VISIBLE,
  "INVENTORY_REVIEW_ID" VARCHAR2(32 BYTE) VISIBLE,
  "INVENTORY_CHECK_SURPLUS" VARCHAR2(32 BYTE) VISIBLE,
  "INVENTORY_CHECK_LOSS" VARCHAR2(32 BYTE) VISIBLE,
  "CREATE_DATE" VARCHAR2(16 BYTE) VISIBLE,
  "SPMS_STATUS" VARCHAR2(2 BYTE) VISIBLE,
  "REQUESTER" VARCHAR2(32 BYTE) VISIBLE,
  "OPERATOR" VARCHAR2(32 BYTE) VISIBLE,
  "REVIEWER" VARCHAR2(32 BYTE) VISIBLE,
  "APPROVER" VARCHAR2(32 BYTE) VISIBLE,
  "CREATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss'),
  "UPDATE_USERNAME" VARCHAR2(64 BYTE) VISIBLE,
  "UPDATE_TIME" DATE VISIBLE
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK"."UUID" IS '海外仓库盘点任务UUID';
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK"."INVENTORY_CHECK_ID" IS '仓库盘点任务单号';
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK"."WERKS" IS '工厂编号';
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK"."WHS_LOCATION_CODE" IS '仓库地点代码';
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK"."INVENTORY_CHECK_TYPE" IS '是否杂货 X-备件货 M-贸易货';
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK"."INVENTORY_CHECK_CATEGORY" IS '盘点类别 1-日常盘点 2-月度盘点 3-动态盘点 4-其它盘点';
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK"."INVENTORY_CHECK_MOLD" IS '盘点类型 1-明盘 2-暗盘';
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK"."INVENTORY_CHECK_DATE" IS '盘点日期';
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK"."INVENTORY_CHECK_RESULT" IS '盘点结果 1-账实相符 2-盘盈 3-盘亏 4-盘盈盘亏';
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK"."IS_REVIEW" IS '是否复盘 1-初盘 2-复盘';
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK"."INVENTORY_REVIEW_ID" IS '复盘单据UUID';
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK"."INVENTORY_CHECK_SURPLUS" IS '盘盈单据号';
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK"."INVENTORY_CHECK_LOSS" IS '盘亏单据号';
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK"."CREATE_DATE" IS '创建日期';
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK"."SPMS_STATUS" IS '任务状态：1-待盘点；2-盘点中；3-复盘中；4-处理中；5-关闭(完成)';
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK"."REQUESTER" IS '创建人工号';
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK"."OPERATOR" IS '申请人';
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK"."REVIEWER" IS '复核人';
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK"."APPROVER" IS '审批人';
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK"."CREATE_TIME" IS '创建时间';
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK"."UPDATE_USERNAME" IS '更新人姓名';
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK"."UPDATE_TIME" IS '更新时间';
COMMENT ON TABLE "SPMS"."OVERSEA_INV_CHECK" IS '海外仓库盘点任务表';

-- ----------------------------
-- Table structure for OVERSEA_INV_CHECK_ACTION
-- ----------------------------
DROP TABLE "SPMS"."OVERSEA_INV_CHECK_ACTION";
CREATE TABLE "SPMS"."OVERSEA_INV_CHECK_ACTION" (
  "UUID" VARCHAR2(32 BYTE) VISIBLE NOT NULL,
  "SPMS_ID" VARCHAR2(32 BYTE) VISIBLE,
  "INVENTORY_ACTION_TYPE" VARCHAR2(6 BYTE) VISIBLE,
  "WERKS" VARCHAR2(6 BYTE) VISIBLE,
  "WHS_LOCATION_CODE" VARCHAR2(6 BYTE) VISIBLE,
  "INVENTORY_CHECK_ID" VARCHAR2(32 BYTE) VISIBLE,
  "INVENTORY_CHECK_RESULT" VARCHAR2(2 BYTE) VISIBLE,
  "INVENTORY_CHECK_TYPE" VARCHAR2(2 BYTE) VISIBLE,
  "INVENTORY_CHECK_CATEGORY" VARCHAR2(2 BYTE) VISIBLE,
  "INVENTORY_CHECK_MOLD" VARCHAR2(2 BYTE) VISIBLE,
  "CREATE_DATE" VARCHAR2(16 BYTE) VISIBLE,
  "SPMS_STATUS" VARCHAR2(2 BYTE) VISIBLE,
  "REQUESTER" VARCHAR2(32 BYTE) VISIBLE,
  "OPERATOR" VARCHAR2(32 BYTE) VISIBLE,
  "REVIEWER" VARCHAR2(32 BYTE) VISIBLE,
  "APPROVER" VARCHAR2(32 BYTE) VISIBLE,
  "CREATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss'),
  "UPDATE_USERNAME" VARCHAR2(64 BYTE) VISIBLE,
  "UPDATE_TIME" DATE VISIBLE,
  "JUSTIFICATION" VARCHAR2(255 BYTE) VISIBLE,
  "REMARKS" VARCHAR2(255 BYTE) VISIBLE,
  "POSTING_DATE" VARCHAR2(16 BYTE) VISIBLE,
  "COST_CENTER" VARCHAR2(16 BYTE) VISIBLE,
  "MOVE_TYPE" VARCHAR2(6 BYTE) VISIBLE,
  "VOUCHER_TEXT" VARCHAR2(255 BYTE) VISIBLE,
  "SAP_VOUCHER_NUMBER" VARCHAR2(16 BYTE) VISIBLE,
  "SAP_VOUCHER_YEAR" VARCHAR2(4 BYTE) VISIBLE,
  "OA_WORKFLOW" VARCHAR2(16 BYTE) VISIBLE,
  "OA_BIANHAO" VARCHAR2(32 BYTE) VISIBLE,
  "OA_REMARK" VARCHAR2(255 BYTE) VISIBLE,
  "SUBMIT_OA_DATE" VARCHAR2(12 BYTE) VISIBLE,
  "OA_APPROVAL_DATE" VARCHAR2(12 BYTE) VISIBLE,
  "OA_FIELD" VARCHAR2(32 BYTE) VISIBLE,
  "BUSINESS_TYPE" VARCHAR2(16 BYTE) VISIBLE
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK_ACTION"."UUID" IS '仓库盘盈盘亏任务UUID';
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK_ACTION"."SPMS_ID" IS '仓库盘盈盘亏单号';
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK_ACTION"."INVENTORY_ACTION_TYPE" IS '盘盈盘亏类别 701-盘盈 702-盘亏';
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK_ACTION"."WERKS" IS '工厂编号';
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK_ACTION"."WHS_LOCATION_CODE" IS '仓库地点代码';
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK_ACTION"."INVENTORY_CHECK_ID" IS '盘点单据号';
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK_ACTION"."INVENTORY_CHECK_RESULT" IS '盘点结果 1-账实相符 2-盘盈 3-盘亏 4-盘盈盘亏';
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK_ACTION"."INVENTORY_CHECK_TYPE" IS '是否杂货 X-备件货 M-贸易货';
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK_ACTION"."INVENTORY_CHECK_CATEGORY" IS '盘点类别 1-日常盘点 2-月度盘点 3-动态盘点 4-其它盘点';
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK_ACTION"."INVENTORY_CHECK_MOLD" IS '盘点类型 1-明盘 2-暗盘';
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK_ACTION"."CREATE_DATE" IS '创建日期';
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK_ACTION"."SPMS_STATUS" IS '任务状态：1-草稿;2-提交OA成功；3-提交OA失败；4-OA审批不通过；5-OA审批通过待上传SAP; 6-上传SAP失败 7 -上传SAP成功 8 - 已撤销';
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK_ACTION"."REQUESTER" IS '创建人工号';
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK_ACTION"."OPERATOR" IS '申请人';
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK_ACTION"."REVIEWER" IS '复核人';
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK_ACTION"."APPROVER" IS '审批人';
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK_ACTION"."CREATE_TIME" IS '创建时间';
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK_ACTION"."UPDATE_USERNAME" IS '更新人姓名';
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK_ACTION"."UPDATE_TIME" IS '更新时间';
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK_ACTION"."JUSTIFICATION" IS '申请原因';
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK_ACTION"."REMARKS" IS '备注';
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK_ACTION"."POSTING_DATE" IS '凭证中的过账日期-用户选';
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK_ACTION"."COST_CENTER" IS '成本中心';
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK_ACTION"."MOVE_TYPE" IS '移动类型';
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK_ACTION"."VOUCHER_TEXT" IS '凭证抬头文本';
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK_ACTION"."SAP_VOUCHER_NUMBER" IS 'SAP物料凭证-提交SAP成功后回写';
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK_ACTION"."SAP_VOUCHER_YEAR" IS '会计年份/SAP凭证年份';
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK_ACTION"."OA_WORKFLOW" IS 'OA流程编号';
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK_ACTION"."OA_BIANHAO" IS 'OA单据编号';
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK_ACTION"."OA_REMARK" IS '提交OA审批备注';
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK_ACTION"."SUBMIT_OA_DATE" IS '提交OA日期';
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK_ACTION"."OA_APPROVAL_DATE" IS 'OA审批通过日期';
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK_ACTION"."OA_FIELD" IS 'OA预留字段';
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK_ACTION"."BUSINESS_TYPE" IS '1-工厂请购单 2-海外收货损益审批 3 海外盘点盘盈盘亏审批 4 海外转储审批';
COMMENT ON TABLE "SPMS"."OVERSEA_INV_CHECK_ACTION" IS '仓库盘盈盘亏';

-- ----------------------------
-- Table structure for OVERSEA_INV_CHECK_ACTION_DTL
-- ----------------------------
DROP TABLE "SPMS"."OVERSEA_INV_CHECK_ACTION_DTL";
CREATE TABLE "SPMS"."OVERSEA_INV_CHECK_ACTION_DTL" (
  "UUID" VARCHAR2(32 BYTE) VISIBLE,
  "TASK_ROW_ID" VARCHAR2(6 BYTE) VISIBLE,
  "MATERIAL_NO" VARCHAR2(32 BYTE) VISIBLE,
  "BOX_NOTE" VARCHAR2(50 BYTE) VISIBLE,
  "INVENTORY_QUANTITY" NUMBER VISIBLE,
  "CHECK_QUANTITY" NUMBER VISIBLE,
  "DISCREPANCY" NUMBER VISIBLE,
  "BASIC_UNIT" VARCHAR2(32 BYTE) VISIBLE,
  "STORAGE_UUID" VARCHAR2(32 BYTE) VISIBLE,
  "REMARKS" VARCHAR2(256 BYTE) VISIBLE,
  "RELATE_ACCOUNT" VARCHAR2(16 BYTE) VISIBLE,
  "VOUCHER_ITEM_TEXT" VARCHAR2(255 BYTE) VISIBLE
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK_ACTION_DTL"."UUID" IS '盘盈盘亏UUID';
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK_ACTION_DTL"."TASK_ROW_ID" IS '盘盈盘亏任务行号';
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK_ACTION_DTL"."MATERIAL_NO" IS '物料编号';
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK_ACTION_DTL"."BOX_NOTE" IS '箱码-仅用于自管仓备件管理';
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK_ACTION_DTL"."INVENTORY_QUANTITY" IS '库存数量';
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK_ACTION_DTL"."CHECK_QUANTITY" IS '实盘数量';
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK_ACTION_DTL"."DISCREPANCY" IS '差异数量';
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK_ACTION_DTL"."BASIC_UNIT" IS '基本单位';
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK_ACTION_DTL"."STORAGE_UUID" IS '储位UUID';
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK_ACTION_DTL"."REMARKS" IS '备注';
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK_ACTION_DTL"."RELATE_ACCOUNT" IS '供应商或债权人的帐号';
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK_ACTION_DTL"."VOUCHER_ITEM_TEXT" IS '项目文本';
COMMENT ON TABLE "SPMS"."OVERSEA_INV_CHECK_ACTION_DTL" IS '盘盈盘亏明细表';

-- ----------------------------
-- Table structure for OVERSEA_INV_CHECK_DTL
-- ----------------------------
DROP TABLE "SPMS"."OVERSEA_INV_CHECK_DTL";
CREATE TABLE "SPMS"."OVERSEA_INV_CHECK_DTL" (
  "UUID" VARCHAR2(32 BYTE) VISIBLE,
  "TASK_ROW_ID" VARCHAR2(6 BYTE) VISIBLE,
  "MATERIAL_NO" VARCHAR2(32 BYTE) VISIBLE,
  "BOX_NOTE" VARCHAR2(50 BYTE) VISIBLE,
  "INVENTORY_QUANTITY" NUMBER VISIBLE,
  "CHECK_QUANTITY" NUMBER VISIBLE,
  "DISCREPANCY" NUMBER VISIBLE,
  "BASIC_UNIT" VARCHAR2(32 BYTE) VISIBLE,
  "STORAGE_UUID" VARCHAR2(32 BYTE) VISIBLE,
  "REMARKS" VARCHAR2(256 BYTE) VISIBLE
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK_DTL"."UUID" IS '盘点任务UUID';
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK_DTL"."TASK_ROW_ID" IS '盘点任务行号';
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK_DTL"."MATERIAL_NO" IS '物料编号';
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK_DTL"."BOX_NOTE" IS '箱码-仅用于自管仓备件管理';
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK_DTL"."INVENTORY_QUANTITY" IS '库存数量';
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK_DTL"."CHECK_QUANTITY" IS '实盘数量';
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK_DTL"."DISCREPANCY" IS '差异数量';
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK_DTL"."BASIC_UNIT" IS '基本单位';
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK_DTL"."STORAGE_UUID" IS '储位UUID';
COMMENT ON COLUMN "SPMS"."OVERSEA_INV_CHECK_DTL"."REMARKS" IS '备注';
COMMENT ON TABLE "SPMS"."OVERSEA_INV_CHECK_DTL" IS '盘点任务表明细表';

-- ----------------------------
-- Table structure for OVERSEA_OPERATE_LOG
-- ----------------------------
DROP TABLE "SPMS"."OVERSEA_OPERATE_LOG";
CREATE TABLE "SPMS"."OVERSEA_OPERATE_LOG" (
  "AUTO_ID_LOG" NUMBER VISIBLE DEFAULT "SPMS"."OVERSEA_OPERATE_LOG_SEQ"."NEXTVAL" NOT NULL,
  "DOCUMENT_NUMBER" VARCHAR2(32 BYTE) VISIBLE,
  "LOG_CONTENT" VARCHAR2(255 BYTE) VISIBLE,
  "LOG_CONTENT_EN" VARCHAR2(255 BYTE) VISIBLE,
  "LOG_TYPE" VARCHAR2(2 BYTE) VISIBLE DEFAULT '1',
  "REQUEST_PARAM" CLOB VISIBLE,
  "RETURNED_MESSAGE" CLOB VISIBLE,
  "REMARK" VARCHAR2(1000 BYTE) VISIBLE,
  "USER_ID" VARCHAR2(16 BYTE) VISIBLE,
  "CREATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss')
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."OVERSEA_OPERATE_LOG"."AUTO_ID_LOG" IS '自增ID';
COMMENT ON COLUMN "SPMS"."OVERSEA_OPERATE_LOG"."DOCUMENT_NUMBER" IS '关联单据号(自增ID或UUID)';
COMMENT ON COLUMN "SPMS"."OVERSEA_OPERATE_LOG"."LOG_CONTENT" IS '日志内容描述';
COMMENT ON COLUMN "SPMS"."OVERSEA_OPERATE_LOG"."LOG_CONTENT_EN" IS '日志内容英文描述';
COMMENT ON COLUMN "SPMS"."OVERSEA_OPERATE_LOG"."LOG_TYPE" IS '日志类型(默认1单据SPMS操作日志;2请求SAP日志;3请求OA日志;)';
COMMENT ON COLUMN "SPMS"."OVERSEA_OPERATE_LOG"."REQUEST_PARAM" IS '请求参数';
COMMENT ON COLUMN "SPMS"."OVERSEA_OPERATE_LOG"."RETURNED_MESSAGE" IS '返回参数';
COMMENT ON COLUMN "SPMS"."OVERSEA_OPERATE_LOG"."REMARK" IS '备注信息';
COMMENT ON COLUMN "SPMS"."OVERSEA_OPERATE_LOG"."USER_ID" IS '用户工号';
COMMENT ON COLUMN "SPMS"."OVERSEA_OPERATE_LOG"."CREATE_TIME" IS '创建时间';
COMMENT ON TABLE "SPMS"."OVERSEA_OPERATE_LOG" IS '海外仓操作日志表';

-- ----------------------------
-- Table structure for OVERSEA_OTHER_DTL
-- ----------------------------
DROP TABLE "SPMS"."OVERSEA_OTHER_DTL";
CREATE TABLE "SPMS"."OVERSEA_OTHER_DTL" (
  "AUTO_ID_OTHER" NUMBER VISIBLE DEFAULT "SPMS"."OVERSEA_OTHER_DTL_SEQ"."NEXTVAL" NOT NULL,
  "UUID" VARCHAR2(32 BYTE) VISIBLE,
  "ITEM" VARCHAR2(6 BYTE) VISIBLE,
  "WERKS" VARCHAR2(8 BYTE) VISIBLE,
  "WORKSHOP_CODE" VARCHAR2(16 BYTE) VISIBLE,
  "WHS_LOCATION_CODE" VARCHAR2(6 BYTE) VISIBLE,
  "MATERIAL_NO" VARCHAR2(32 BYTE) VISIBLE,
  "ACTUAL_QTY_BASIC_UNIT" NUMBER VISIBLE DEFAULT 0,
  "STORAGE_INFO" VARCHAR2(2000 BYTE) VISIBLE,
  "BASIC_UNIT" VARCHAR2(6 BYTE) VISIBLE,
  "COST_CENTER" VARCHAR2(32 BYTE) VISIBLE,
  "MATERIAL_NO_ADJUSTED" VARCHAR2(32 BYTE) VISIBLE,
  "ACTUAL_QTY_BASIC_UNIT_ADJUSTED" NUMBER VISIBLE DEFAULT 0,
  "STORAGE_INFO_ADJUSTED" VARCHAR2(2000 BYTE) VISIBLE,
  "SUPPLIER_NO" VARCHAR2(16 BYTE) VISIBLE,
  "SAP_DELIVERY_NOTE" VARCHAR2(16 BYTE) VISIBLE,
  "SAP_DELIVERY_NOTE_ITEM" VARCHAR2(6 BYTE) VISIBLE,
  "REMARKS" VARCHAR2(255 BYTE) VISIBLE,
  "COMMENTS" VARCHAR2(255 BYTE) VISIBLE
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."OVERSEA_OTHER_DTL"."AUTO_ID_OTHER" IS '其他出入库明细自增ID';
COMMENT ON COLUMN "SPMS"."OVERSEA_OTHER_DTL"."UUID" IS '海外仓其他出入库UUID';
COMMENT ON COLUMN "SPMS"."OVERSEA_OTHER_DTL"."ITEM" IS '其他出入库明细行号';
COMMENT ON COLUMN "SPMS"."OVERSEA_OTHER_DTL"."WERKS" IS '工厂代码';
COMMENT ON COLUMN "SPMS"."OVERSEA_OTHER_DTL"."WORKSHOP_CODE" IS '车间代码';
COMMENT ON COLUMN "SPMS"."OVERSEA_OTHER_DTL"."WHS_LOCATION_CODE" IS '仓库代码';
COMMENT ON COLUMN "SPMS"."OVERSEA_OTHER_DTL"."MATERIAL_NO" IS '物料编号(串货调整时,出库料号)';
COMMENT ON COLUMN "SPMS"."OVERSEA_OTHER_DTL"."ACTUAL_QTY_BASIC_UNIT" IS '出入库操作基本单位数量(串货调整时,出库数量)';
COMMENT ON COLUMN "SPMS"."OVERSEA_OTHER_DTL"."STORAGE_INFO" IS '储位信息(串货调整时,出库储位)';
COMMENT ON COLUMN "SPMS"."OVERSEA_OTHER_DTL"."BASIC_UNIT" IS '基本单位';
COMMENT ON COLUMN "SPMS"."OVERSEA_OTHER_DTL"."COST_CENTER" IS '成本中心';
COMMENT ON COLUMN "SPMS"."OVERSEA_OTHER_DTL"."MATERIAL_NO_ADJUSTED" IS '调整后的物料编号(仅串货调整时,入库料号)';
COMMENT ON COLUMN "SPMS"."OVERSEA_OTHER_DTL"."ACTUAL_QTY_BASIC_UNIT_ADJUSTED" IS '调整后入库操作基本单位数量(仅串货调整时,入库数量)';
COMMENT ON COLUMN "SPMS"."OVERSEA_OTHER_DTL"."STORAGE_INFO_ADJUSTED" IS '调整后储位信息(仅串货调整时,入库储位)';
COMMENT ON COLUMN "SPMS"."OVERSEA_OTHER_DTL"."SUPPLIER_NO" IS '供应商编号(仅串货调整可选输入)';
COMMENT ON COLUMN "SPMS"."OVERSEA_OTHER_DTL"."SAP_DELIVERY_NOTE" IS '交货单号(仅收货多收填写)';
COMMENT ON COLUMN "SPMS"."OVERSEA_OTHER_DTL"."SAP_DELIVERY_NOTE_ITEM" IS '交货单行号(仅收货多收填写)';
COMMENT ON COLUMN "SPMS"."OVERSEA_OTHER_DTL"."REMARKS" IS '行备注';
COMMENT ON COLUMN "SPMS"."OVERSEA_OTHER_DTL"."COMMENTS" IS '行评论';
COMMENT ON TABLE "SPMS"."OVERSEA_OTHER_DTL" IS '海外仓其他出入库明细';

-- ----------------------------
-- Table structure for OVERSEA_OTHER_TASK
-- ----------------------------
DROP TABLE "SPMS"."OVERSEA_OTHER_TASK";
CREATE TABLE "SPMS"."OVERSEA_OTHER_TASK" (
  "UUID" VARCHAR2(32 BYTE) VISIBLE NOT NULL,
  "OPERATE_TITLE" VARCHAR2(128 BYTE) VISIBLE,
  "SPMS_ID" VARCHAR2(32 BYTE) VISIBLE,
  "MOVEMENT_TYPE" VARCHAR2(8 BYTE) VISIBLE,
  "SPMS_STATUS" VARCHAR2(2 BYTE) VISIBLE,
  "WERKS" VARCHAR2(8 BYTE) VISIBLE,
  "WORKSHOP_CODE" VARCHAR2(16 BYTE) VISIBLE,
  "WHS_LOCATION_CODE" VARCHAR2(6 BYTE) VISIBLE,
  "CREATE_DATE" VARCHAR2(16 BYTE) VISIBLE,
  "SAP_DELIVERY_NOTE" VARCHAR2(16 BYTE) VISIBLE,
  "CREATE_USERID" VARCHAR2(16 BYTE) VISIBLE,
  "COST_CENTER" VARCHAR2(32 BYTE) VISIBLE,
  "REMARKS" VARCHAR2(255 BYTE) VISIBLE,
  "COMMENTS" VARCHAR2(255 BYTE) VISIBLE,
  "PURCHASE_GROUP" VARCHAR2(3 BYTE) VISIBLE,
  "PURCHASE_ORG" VARCHAR2(4 BYTE) VISIBLE,
  "POSTING_DATE" VARCHAR2(16 BYTE) VISIBLE,
  "SAP_VOUCHER_NUMBER" VARCHAR2(32 BYTE) VISIBLE,
  "SAP_VOUCHER_YEAR" VARCHAR2(8 BYTE) VISIBLE,
  "CANCEL_POSTING_DATE" VARCHAR2(16 BYTE) VISIBLE,
  "CANCEL_VOUCHER_NUMBER" VARCHAR2(32 BYTE) VISIBLE,
  "CANCEL_VOUCHER_YEAR" VARCHAR2(8 BYTE) VISIBLE,
  "DATA_VERSION" NUMBER VISIBLE DEFAULT "SPMS"."DATA_VERSION"."NEXTVAL",
  "CREATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss'),
  "UPDATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss')
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."OVERSEA_OTHER_TASK"."UUID" IS '海外仓其他出入库UUID';
COMMENT ON COLUMN "SPMS"."OVERSEA_OTHER_TASK"."OPERATE_TITLE" IS '其他出入库操作标题';
COMMENT ON COLUMN "SPMS"."OVERSEA_OTHER_TASK"."SPMS_ID" IS '其他出入库SPMS单号';
COMMENT ON COLUMN "SPMS"."OVERSEA_OTHER_TASK"."MOVEMENT_TYPE" IS '报废出库551;零价格出库Z55;零价格入库Z56;收货多收Z16;串货调整309;不可抗力出库Z13;IT专用出库Z47;期初库存增加561;期初库存减少562;';
COMMENT ON COLUMN "SPMS"."OVERSEA_OTHER_TASK"."SPMS_STATUS" IS 'SPMS状态(0已删除;1保存;2提交/待审批;3审批不通过;4审批通过;5提交SAP失败;6提交SAP成功;)';
COMMENT ON COLUMN "SPMS"."OVERSEA_OTHER_TASK"."WERKS" IS '工厂代码';
COMMENT ON COLUMN "SPMS"."OVERSEA_OTHER_TASK"."WORKSHOP_CODE" IS '车间代码';
COMMENT ON COLUMN "SPMS"."OVERSEA_OTHER_TASK"."WHS_LOCATION_CODE" IS '仓库代码';
COMMENT ON COLUMN "SPMS"."OVERSEA_OTHER_TASK"."CREATE_DATE" IS '创建日期';
COMMENT ON COLUMN "SPMS"."OVERSEA_OTHER_TASK"."SAP_DELIVERY_NOTE" IS '交货单号(仅收货多收填写)';
COMMENT ON COLUMN "SPMS"."OVERSEA_OTHER_TASK"."CREATE_USERID" IS '创建人工号';
COMMENT ON COLUMN "SPMS"."OVERSEA_OTHER_TASK"."COST_CENTER" IS '成本中心';
COMMENT ON COLUMN "SPMS"."OVERSEA_OTHER_TASK"."REMARKS" IS '备注';
COMMENT ON COLUMN "SPMS"."OVERSEA_OTHER_TASK"."COMMENTS" IS '评论';
COMMENT ON COLUMN "SPMS"."OVERSEA_OTHER_TASK"."PURCHASE_GROUP" IS '采购组';
COMMENT ON COLUMN "SPMS"."OVERSEA_OTHER_TASK"."PURCHASE_ORG" IS '采购组织';
COMMENT ON COLUMN "SPMS"."OVERSEA_OTHER_TASK"."POSTING_DATE" IS '过账日期';
COMMENT ON COLUMN "SPMS"."OVERSEA_OTHER_TASK"."SAP_VOUCHER_NUMBER" IS 'SAP凭证号';
COMMENT ON COLUMN "SPMS"."OVERSEA_OTHER_TASK"."SAP_VOUCHER_YEAR" IS 'SAP凭证年份';
COMMENT ON COLUMN "SPMS"."OVERSEA_OTHER_TASK"."CANCEL_POSTING_DATE" IS '撤销SAP过账日期';
COMMENT ON COLUMN "SPMS"."OVERSEA_OTHER_TASK"."CANCEL_VOUCHER_NUMBER" IS '撤销SAP凭证';
COMMENT ON COLUMN "SPMS"."OVERSEA_OTHER_TASK"."CANCEL_VOUCHER_YEAR" IS '撤销SAP凭证年份';
COMMENT ON COLUMN "SPMS"."OVERSEA_OTHER_TASK"."DATA_VERSION" IS '数据版本号';
COMMENT ON COLUMN "SPMS"."OVERSEA_OTHER_TASK"."CREATE_TIME" IS '创建时间';
COMMENT ON COLUMN "SPMS"."OVERSEA_OTHER_TASK"."UPDATE_TIME" IS '更新时间';
COMMENT ON TABLE "SPMS"."OVERSEA_OTHER_TASK" IS '海外仓其他出入库';

-- ----------------------------
-- Table structure for OVERSEA_PACKAGE_LIST
-- ----------------------------
DROP TABLE "SPMS"."OVERSEA_PACKAGE_LIST";
CREATE TABLE "SPMS"."OVERSEA_PACKAGE_LIST" (
  "UUID_PACKAGE_LIST" VARCHAR2(32 BYTE) VISIBLE NOT NULL,
  "SAP_PACKAGE_LIST" VARCHAR2(16 BYTE) VISIBLE,
  "MERCHANDISER" VARCHAR2(32 BYTE) VISIBLE,
  "CABINET_MODEL" VARCHAR2(16 BYTE) VISIBLE,
  "FROM_PORT" VARCHAR2(64 BYTE) VISIBLE,
  "TO_PORT" VARCHAR2(64 BYTE) VISIBLE,
  "DATA_STATUS" VARCHAR2(2 BYTE) VISIBLE DEFAULT '0',
  "CREATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss'),
  "UPDATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss')
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."OVERSEA_PACKAGE_LIST"."UUID_PACKAGE_LIST" IS '装箱单uuid';
COMMENT ON COLUMN "SPMS"."OVERSEA_PACKAGE_LIST"."SAP_PACKAGE_LIST" IS '装箱单号';
COMMENT ON COLUMN "SPMS"."OVERSEA_PACKAGE_LIST"."MERCHANDISER" IS '跟单员';
COMMENT ON COLUMN "SPMS"."OVERSEA_PACKAGE_LIST"."CABINET_MODEL" IS '柜型';
COMMENT ON COLUMN "SPMS"."OVERSEA_PACKAGE_LIST"."FROM_PORT" IS '起运港';
COMMENT ON COLUMN "SPMS"."OVERSEA_PACKAGE_LIST"."TO_PORT" IS '目的港';
COMMENT ON COLUMN "SPMS"."OVERSEA_PACKAGE_LIST"."DATA_STATUS" IS '数据状态(默认0能被SAP更新数据；1禁止更新数据；)';
COMMENT ON COLUMN "SPMS"."OVERSEA_PACKAGE_LIST"."CREATE_TIME" IS '创建时间';
COMMENT ON COLUMN "SPMS"."OVERSEA_PACKAGE_LIST"."UPDATE_TIME" IS '更新时间';
COMMENT ON TABLE "SPMS"."OVERSEA_PACKAGE_LIST" IS '海外仓装箱单表';

-- ----------------------------
-- Table structure for OVERSEA_PACKAGE_LIST_BOX
-- ----------------------------
DROP TABLE "SPMS"."OVERSEA_PACKAGE_LIST_BOX";
CREATE TABLE "SPMS"."OVERSEA_PACKAGE_LIST_BOX" (
  "AUTO_ID_PACKAGE_BOX" NUMBER VISIBLE DEFAULT "SPMS"."OVERSEA_PACKAGE_LIST_BOX_SEQ"."NEXTVAL" NOT NULL,
  "SAP_PACKAGE_LIST" VARCHAR2(16 BYTE) VISIBLE,
  "SAP_PACKAGE_LIST_ITEM" VARCHAR2(6 BYTE) VISIBLE,
  "BOX_NOTE" VARCHAR2(50 BYTE) VISIBLE,
  "BOX_NOTE_ITEM" VARCHAR2(6 BYTE) VISIBLE,
  "BOX_STATUS" VARCHAR2(2 BYTE) VISIBLE DEFAULT '0',
  "DATA_STATUS" VARCHAR2(2 BYTE) VISIBLE DEFAULT '0',
  "ARRIVAL_DATE" VARCHAR2(16 BYTE) VISIBLE,
  "UPDATE_USERID" VARCHAR2(16 BYTE) VISIBLE,
  "CREATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss'),
  "UPDATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss'),
  "WERKS_RECEIVE" VARCHAR2(6 BYTE) VISIBLE,
  "WHS_LOCATION_CODE_RECEIVE" VARCHAR2(6 BYTE) VISIBLE,
  "MATERIAL_NO" VARCHAR2(32 BYTE) VISIBLE,
  "RECEIVABLE_QTY_BASIC_UNIT" NUMBER VISIBLE DEFAULT 0,
  "ACTUAL_QTY_BASIC_UNIT" NUMBER VISIBLE DEFAULT 0,
  "BASIC_UNIT" VARCHAR2(6 BYTE) VISIBLE,
  "DEMAND_NO" VARCHAR2(32 BYTE) VISIBLE,
  "DEMAND_ITEM" VARCHAR2(6 BYTE) VISIBLE,
  "DEMANDER" VARCHAR2(128 BYTE) VISIBLE
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."OVERSEA_PACKAGE_LIST_BOX"."AUTO_ID_PACKAGE_BOX" IS 'SPMS唯一自增ID';
COMMENT ON COLUMN "SPMS"."OVERSEA_PACKAGE_LIST_BOX"."SAP_PACKAGE_LIST" IS '装箱单号';
COMMENT ON COLUMN "SPMS"."OVERSEA_PACKAGE_LIST_BOX"."SAP_PACKAGE_LIST_ITEM" IS '装箱单行号';
COMMENT ON COLUMN "SPMS"."OVERSEA_PACKAGE_LIST_BOX"."BOX_NOTE" IS '箱码';
COMMENT ON COLUMN "SPMS"."OVERSEA_PACKAGE_LIST_BOX"."BOX_NOTE_ITEM" IS '箱码行号(对应箱码明细表的ITEM字段)';
COMMENT ON COLUMN "SPMS"."OVERSEA_PACKAGE_LIST_BOX"."BOX_STATUS" IS '箱码状态(默认0待到货;1已到货;)';
COMMENT ON COLUMN "SPMS"."OVERSEA_PACKAGE_LIST_BOX"."DATA_STATUS" IS '数据状态(默认0能被SAP更新数据；1禁止更新数据；)';
COMMENT ON COLUMN "SPMS"."OVERSEA_PACKAGE_LIST_BOX"."ARRIVAL_DATE" IS '箱码到货日期';
COMMENT ON COLUMN "SPMS"."OVERSEA_PACKAGE_LIST_BOX"."UPDATE_USERID" IS '最后更新人(确认到货人工号)';
COMMENT ON COLUMN "SPMS"."OVERSEA_PACKAGE_LIST_BOX"."CREATE_TIME" IS '创建时间';
COMMENT ON COLUMN "SPMS"."OVERSEA_PACKAGE_LIST_BOX"."UPDATE_TIME" IS '更新时间';
COMMENT ON COLUMN "SPMS"."OVERSEA_PACKAGE_LIST_BOX"."WERKS_RECEIVE" IS '实际收货工厂';
COMMENT ON COLUMN "SPMS"."OVERSEA_PACKAGE_LIST_BOX"."WHS_LOCATION_CODE_RECEIVE" IS '实际收货仓库';
COMMENT ON COLUMN "SPMS"."OVERSEA_PACKAGE_LIST_BOX"."MATERIAL_NO" IS '物料编号';
COMMENT ON COLUMN "SPMS"."OVERSEA_PACKAGE_LIST_BOX"."RECEIVABLE_QTY_BASIC_UNIT" IS '基本单位发货数量/海外应收基本单位数量';
COMMENT ON COLUMN "SPMS"."OVERSEA_PACKAGE_LIST_BOX"."ACTUAL_QTY_BASIC_UNIT" IS '实收基本单位数量';
COMMENT ON COLUMN "SPMS"."OVERSEA_PACKAGE_LIST_BOX"."BASIC_UNIT" IS '基本单位';
COMMENT ON COLUMN "SPMS"."OVERSEA_PACKAGE_LIST_BOX"."DEMAND_NO" IS '需求来源号';
COMMENT ON COLUMN "SPMS"."OVERSEA_PACKAGE_LIST_BOX"."DEMAND_ITEM" IS '需求来源行号';
COMMENT ON COLUMN "SPMS"."OVERSEA_PACKAGE_LIST_BOX"."DEMANDER" IS '需求申请人';
COMMENT ON TABLE "SPMS"."OVERSEA_PACKAGE_LIST_BOX" IS '海外仓收货装箱单箱码关系表';

-- ----------------------------
-- Table structure for OVERSEA_PACKAGE_LIST_DTL
-- ----------------------------
DROP TABLE "SPMS"."OVERSEA_PACKAGE_LIST_DTL";
CREATE TABLE "SPMS"."OVERSEA_PACKAGE_LIST_DTL" (
  "AUTO_ID_PACKAGE_LIST" NUMBER VISIBLE DEFAULT "SPMS"."OVERSEA_PACKAGE_LIST_DTL_SEQ"."NEXTVAL" NOT NULL,
  "SAP_PACKAGE_LIST" VARCHAR2(16 BYTE) VISIBLE,
  "SAP_PACKAGE_LIST_ITEM" VARCHAR2(6 BYTE) VISIBLE,
  "SAP_DELIVERY_NOTE" VARCHAR2(16 BYTE) VISIBLE,
  "PURCHASE_NO" VARCHAR2(16 BYTE) VISIBLE,
  "PURCHASE_NO_ITEM" VARCHAR2(6 BYTE) VISIBLE,
  "DATA_STATUS" VARCHAR2(2 BYTE) VISIBLE,
  "CREATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss'),
  "UPDATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss')
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."OVERSEA_PACKAGE_LIST_DTL"."AUTO_ID_PACKAGE_LIST" IS '装箱单明细自增ID';
COMMENT ON COLUMN "SPMS"."OVERSEA_PACKAGE_LIST_DTL"."SAP_PACKAGE_LIST" IS '装箱单号';
COMMENT ON COLUMN "SPMS"."OVERSEA_PACKAGE_LIST_DTL"."SAP_PACKAGE_LIST_ITEM" IS '装箱单行号';
COMMENT ON COLUMN "SPMS"."OVERSEA_PACKAGE_LIST_DTL"."SAP_DELIVERY_NOTE" IS '交货单号';
COMMENT ON COLUMN "SPMS"."OVERSEA_PACKAGE_LIST_DTL"."PURCHASE_NO" IS '公司间采购订单号';
COMMENT ON COLUMN "SPMS"."OVERSEA_PACKAGE_LIST_DTL"."PURCHASE_NO_ITEM" IS '公司间采购订单行项目';
COMMENT ON COLUMN "SPMS"."OVERSEA_PACKAGE_LIST_DTL"."DATA_STATUS" IS '数据状态(默认0能被SAP更新数据；1禁止更新数据；)';
COMMENT ON COLUMN "SPMS"."OVERSEA_PACKAGE_LIST_DTL"."CREATE_TIME" IS '创建时间';
COMMENT ON COLUMN "SPMS"."OVERSEA_PACKAGE_LIST_DTL"."UPDATE_TIME" IS '更新时间';
COMMENT ON TABLE "SPMS"."OVERSEA_PACKAGE_LIST_DTL" IS '海外装箱单明细表';

-- ----------------------------
-- Table structure for OVERSEA_PURCHASE_ORDER
-- ----------------------------
DROP TABLE "SPMS"."OVERSEA_PURCHASE_ORDER";
CREATE TABLE "SPMS"."OVERSEA_PURCHASE_ORDER" (
  "UUID_PURCHASE_ORDER" VARCHAR2(32 BYTE) VISIBLE NOT NULL,
  "SAP_PURCHASE_ORDER" VARCHAR2(16 BYTE) VISIBLE,
  "BUSINESS_TYPE" VARCHAR2(4 BYTE) VISIBLE,
  "SAP_CREATE_DATE" VARCHAR2(16 BYTE) VISIBLE,
  "SUPPLIER_CODE" VARCHAR2(16 BYTE) VISIBLE,
  "SUPPLIER_DESC" VARCHAR2(255 BYTE) VISIBLE,
  "WERKS_DELIVERY" VARCHAR2(6 BYTE) VISIBLE,
  "PURCHASE_GROUP" VARCHAR2(3 BYTE) VISIBLE,
  "PURCHASE_ORG" VARCHAR2(4 BYTE) VISIBLE,
  "CREATE_USER" VARCHAR2(32 BYTE) VISIBLE,
  "VOUCHER_TYPE" VARCHAR2(6 BYTE) VISIBLE,
  "SAP_REMARK" VARCHAR2(255 BYTE) VISIBLE,
  "DATA_STATUS" VARCHAR2(2 BYTE) VISIBLE DEFAULT '0',
  "DATA_VERSION" NUMBER VISIBLE DEFAULT "SPMS"."DATA_VERSION"."NEXTVAL",
  "CREATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss'),
  "UPDATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss')
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."OVERSEA_PURCHASE_ORDER"."UUID_PURCHASE_ORDER" IS '采购订单表uuid';
COMMENT ON COLUMN "SPMS"."OVERSEA_PURCHASE_ORDER"."SAP_PURCHASE_ORDER" IS '采购凭证号PO';
COMMENT ON COLUMN "SPMS"."OVERSEA_PURCHASE_ORDER"."BUSINESS_TYPE" IS '业务标识(01空运人带;02本地采购;03海外转储;05退货订单;)';
COMMENT ON COLUMN "SPMS"."OVERSEA_PURCHASE_ORDER"."SAP_CREATE_DATE" IS 'SAP凭证日期';
COMMENT ON COLUMN "SPMS"."OVERSEA_PURCHASE_ORDER"."SUPPLIER_CODE" IS '供应商编号';
COMMENT ON COLUMN "SPMS"."OVERSEA_PURCHASE_ORDER"."SUPPLIER_DESC" IS '供应商名称';
COMMENT ON COLUMN "SPMS"."OVERSEA_PURCHASE_ORDER"."WERKS_DELIVERY" IS '发货/转出工厂';
COMMENT ON COLUMN "SPMS"."OVERSEA_PURCHASE_ORDER"."PURCHASE_GROUP" IS '采购组(当业务标识为01、03时，满足下列数据的值才取，240海外转储，260为空运，250人带)';
COMMENT ON COLUMN "SPMS"."OVERSEA_PURCHASE_ORDER"."PURCHASE_ORG" IS '采购组织';
COMMENT ON COLUMN "SPMS"."OVERSEA_PURCHASE_ORDER"."CREATE_USER" IS '建单人';
COMMENT ON COLUMN "SPMS"."OVERSEA_PURCHASE_ORDER"."VOUCHER_TYPE" IS '凭证类型(当业务标识为02时，ZN03为本地采购订单)';
COMMENT ON COLUMN "SPMS"."OVERSEA_PURCHASE_ORDER"."SAP_REMARK" IS 'SAP表头文本';
COMMENT ON COLUMN "SPMS"."OVERSEA_PURCHASE_ORDER"."DATA_STATUS" IS '数据状态(默认0能被SAP更新数据；1禁止更新数据；)';
COMMENT ON COLUMN "SPMS"."OVERSEA_PURCHASE_ORDER"."DATA_VERSION" IS '数据版本号';
COMMENT ON COLUMN "SPMS"."OVERSEA_PURCHASE_ORDER"."CREATE_TIME" IS '创建时间';
COMMENT ON COLUMN "SPMS"."OVERSEA_PURCHASE_ORDER"."UPDATE_TIME" IS '更新时间';
COMMENT ON TABLE "SPMS"."OVERSEA_PURCHASE_ORDER" IS '海外仓采购订单表';

-- ----------------------------
-- Table structure for OVERSEA_PURCHASE_ORDER_DTL
-- ----------------------------
DROP TABLE "SPMS"."OVERSEA_PURCHASE_ORDER_DTL";
CREATE TABLE "SPMS"."OVERSEA_PURCHASE_ORDER_DTL" (
  "AUTO_ID_PURCHASE_ORDER" NUMBER VISIBLE DEFAULT "SPMS"."OVERSEA_PURCHASE_ORDER_DTL_SEQ"."NEXTVAL" NOT NULL,
  "SAP_PURCHASE_ORDER" VARCHAR2(16 BYTE) VISIBLE,
  "SAP_PURCHASE_ORDER_ITEM" VARCHAR2(6 BYTE) VISIBLE,
  "DELIVERY_DATE" VARCHAR2(16 BYTE) VISIBLE,
  "WERKS_RECEIVE" VARCHAR2(6 BYTE) VISIBLE,
  "WHS_LOCATION_CODE_RECEIVE" VARCHAR2(6 BYTE) VISIBLE,
  "MATERIAL_NO" VARCHAR2(32 BYTE) VISIBLE,
  "MATERIAL_ZH_DESC" VARCHAR2(255 BYTE) VISIBLE,
  "BASIC_UNIT" VARCHAR2(6 BYTE) VISIBLE,
  "RECEIVABLE_QTY_BASIC_UNIT" NUMBER VISIBLE DEFAULT 0,
  "RETURN_MARK" VARCHAR2(2 BYTE) VISIBLE,
  "DATA_STATUS" VARCHAR2(2 BYTE) VISIBLE DEFAULT '0',
  "DATA_VERSION" NUMBER VISIBLE DEFAULT "SPMS"."DATA_VERSION"."NEXTVAL",
  "CREATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss'),
  "UPDATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss')
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."OVERSEA_PURCHASE_ORDER_DTL"."AUTO_ID_PURCHASE_ORDER" IS '采购订单明细自增ID';
COMMENT ON COLUMN "SPMS"."OVERSEA_PURCHASE_ORDER_DTL"."SAP_PURCHASE_ORDER" IS '采购凭证号PO';
COMMENT ON COLUMN "SPMS"."OVERSEA_PURCHASE_ORDER_DTL"."SAP_PURCHASE_ORDER_ITEM" IS '采购凭证号PO行号';
COMMENT ON COLUMN "SPMS"."OVERSEA_PURCHASE_ORDER_DTL"."DELIVERY_DATE" IS 'DN交货日期';
COMMENT ON COLUMN "SPMS"."OVERSEA_PURCHASE_ORDER_DTL"."WERKS_RECEIVE" IS '收货/转入工厂';
COMMENT ON COLUMN "SPMS"."OVERSEA_PURCHASE_ORDER_DTL"."WHS_LOCATION_CODE_RECEIVE" IS '收货/转入仓库地址';
COMMENT ON COLUMN "SPMS"."OVERSEA_PURCHASE_ORDER_DTL"."MATERIAL_NO" IS '物料编号';
COMMENT ON COLUMN "SPMS"."OVERSEA_PURCHASE_ORDER_DTL"."MATERIAL_ZH_DESC" IS '物料描述';
COMMENT ON COLUMN "SPMS"."OVERSEA_PURCHASE_ORDER_DTL"."BASIC_UNIT" IS '基本单位';
COMMENT ON COLUMN "SPMS"."OVERSEA_PURCHASE_ORDER_DTL"."RECEIVABLE_QTY_BASIC_UNIT" IS '交货数量/应收基本单位数量';
COMMENT ON COLUMN "SPMS"."OVERSEA_PURCHASE_ORDER_DTL"."RETURN_MARK" IS '退货标识';
COMMENT ON COLUMN "SPMS"."OVERSEA_PURCHASE_ORDER_DTL"."DATA_STATUS" IS '数据状态(默认0能被SAP更新数据；1禁止更新数据；)';
COMMENT ON COLUMN "SPMS"."OVERSEA_PURCHASE_ORDER_DTL"."DATA_VERSION" IS '数据版本号';
COMMENT ON COLUMN "SPMS"."OVERSEA_PURCHASE_ORDER_DTL"."CREATE_TIME" IS '创建时间';
COMMENT ON COLUMN "SPMS"."OVERSEA_PURCHASE_ORDER_DTL"."UPDATE_TIME" IS '更新时间';
COMMENT ON TABLE "SPMS"."OVERSEA_PURCHASE_ORDER_DTL" IS '海外仓采购订单表明细';

-- ----------------------------
-- Table structure for OVERSEA_REQUISITION
-- ----------------------------
DROP TABLE "SPMS"."OVERSEA_REQUISITION";
CREATE TABLE "SPMS"."OVERSEA_REQUISITION" (
  "AUTO_ID_REQUISITION" NUMBER VISIBLE DEFAULT "SPMS"."OVERSEA_REQUISITION_SEQ"."NEXTVAL",
  "UUID_REQUISITION" VARCHAR2(32 BYTE) VISIBLE NOT NULL,
  "SPMS_ID" VARCHAR2(32 BYTE) VISIBLE,
  "CREATE_DATE" VARCHAR2(16 BYTE) VISIBLE,
  "BUSINESS_TYPE" VARCHAR2(32 BYTE) VISIBLE,
  "SPMS_STATUS" VARCHAR2(2 BYTE) VISIBLE DEFAULT '1',
  "CREATE_USERID" VARCHAR2(16 BYTE) VISIBLE,
  "WERKS" VARCHAR2(16 BYTE) VISIBLE,
  "WORKSHOP_CODE" VARCHAR2(32 BYTE) VISIBLE,
  "WHS_LOCATION_CODE" VARCHAR2(16 BYTE) VISIBLE,
  "RELATE_DOCUMENT" VARCHAR2(32 BYTE) VISIBLE,
  "COST_CENTER" VARCHAR2(32 BYTE) VISIBLE,
  "DATA_VERSION" NUMBER VISIBLE DEFAULT "SPMS"."DATA_VERSION"."NEXTVAL",
  "REMARKS" VARCHAR2(255 BYTE) VISIBLE,
  "COMMENTS" VARCHAR2(255 BYTE) VISIBLE,
  "CREATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss'),
  "UPDATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss'),
  "COST_CENTER_NAME" VARCHAR2(255 BYTE) VISIBLE,
  "APPROVAL_DATE" VARCHAR2(12 BYTE) VISIBLE
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."OVERSEA_REQUISITION"."AUTO_ID_REQUISITION" IS '领用申请表自增ID';
COMMENT ON COLUMN "SPMS"."OVERSEA_REQUISITION"."UUID_REQUISITION" IS '领用申请UUID';
COMMENT ON COLUMN "SPMS"."OVERSEA_REQUISITION"."SPMS_ID" IS '领用申请单号';
COMMENT ON COLUMN "SPMS"."OVERSEA_REQUISITION"."CREATE_DATE" IS '创建日期';
COMMENT ON COLUMN "SPMS"."OVERSEA_REQUISITION"."BUSINESS_TYPE" IS '业务类型';
COMMENT ON COLUMN "SPMS"."OVERSEA_REQUISITION"."SPMS_STATUS" IS '单据状态(0已删除;1待提交;2待审批;3审批通过;4审批拒绝;5已生成出库任务;)';
COMMENT ON COLUMN "SPMS"."OVERSEA_REQUISITION"."CREATE_USERID" IS '申请人';
COMMENT ON COLUMN "SPMS"."OVERSEA_REQUISITION"."WERKS" IS '工厂代码';
COMMENT ON COLUMN "SPMS"."OVERSEA_REQUISITION"."WORKSHOP_CODE" IS '车间代码';
COMMENT ON COLUMN "SPMS"."OVERSEA_REQUISITION"."WHS_LOCATION_CODE" IS '仓库地点代码';
COMMENT ON COLUMN "SPMS"."OVERSEA_REQUISITION"."RELATE_DOCUMENT" IS '来源单号';
COMMENT ON COLUMN "SPMS"."OVERSEA_REQUISITION"."COST_CENTER" IS '成本中心';
COMMENT ON COLUMN "SPMS"."OVERSEA_REQUISITION"."DATA_VERSION" IS '数据版本号';
COMMENT ON COLUMN "SPMS"."OVERSEA_REQUISITION"."REMARKS" IS '备注/申请原因';
COMMENT ON COLUMN "SPMS"."OVERSEA_REQUISITION"."COMMENTS" IS '评论/标题';
COMMENT ON COLUMN "SPMS"."OVERSEA_REQUISITION"."CREATE_TIME" IS '创建时间';
COMMENT ON COLUMN "SPMS"."OVERSEA_REQUISITION"."UPDATE_TIME" IS '更新时间';
COMMENT ON COLUMN "SPMS"."OVERSEA_REQUISITION"."COST_CENTER_NAME" IS '成本中心名称';
COMMENT ON COLUMN "SPMS"."OVERSEA_REQUISITION"."APPROVAL_DATE" IS '审批通过日期';
COMMENT ON TABLE "SPMS"."OVERSEA_REQUISITION" IS '领用申请表';

-- ----------------------------
-- Table structure for OVERSEA_REQUISITION_DTL
-- ----------------------------
DROP TABLE "SPMS"."OVERSEA_REQUISITION_DTL";
CREATE TABLE "SPMS"."OVERSEA_REQUISITION_DTL" (
  "AUTO_ID_REQUISITION_DTL" NUMBER VISIBLE DEFAULT "SPMS"."OVERSEA_REQUISITION_DTL_SEQ"."NEXTVAL" NOT NULL,
  "UUID_REQUISITION" VARCHAR2(32 BYTE) VISIBLE,
  "ITEM" NUMBER VISIBLE,
  "WERKS" VARCHAR2(16 BYTE) VISIBLE,
  "WORKSHOP_CODE" VARCHAR2(16 BYTE) VISIBLE,
  "WHS_LOCATION_CODE" VARCHAR2(16 BYTE) VISIBLE,
  "MATERIAL_NO" VARCHAR2(32 BYTE) VISIBLE,
  "APPLY_QTY_BASIC_UNIT" NUMBER VISIBLE,
  "ACTUAL_QTY_BASIC_UNIT" NUMBER VISIBLE,
  "BASIC_UNIT" VARCHAR2(6 BYTE) VISIBLE,
  "APPLY_QTY_UNIT_SALES" NUMBER VISIBLE,
  "ACTUAL_QTY_UNIT_SALES" NUMBER VISIBLE,
  "UNIT_SALES" VARCHAR2(6 BYTE) VISIBLE,
  "REMARKS" VARCHAR2(255 BYTE) VISIBLE,
  "STORAGE_INFO" VARCHAR2(2000 BYTE) VISIBLE,
  "MOVEMENT_TYPE" VARCHAR2(12 BYTE) VISIBLE,
  "ACTUAL_MOVEMENT_TYPE" VARCHAR2(12 BYTE) VISIBLE
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."OVERSEA_REQUISITION_DTL"."AUTO_ID_REQUISITION_DTL" IS '领用申请明细表自增ID';
COMMENT ON COLUMN "SPMS"."OVERSEA_REQUISITION_DTL"."UUID_REQUISITION" IS '领用申请UUID';
COMMENT ON COLUMN "SPMS"."OVERSEA_REQUISITION_DTL"."ITEM" IS '明细行号';
COMMENT ON COLUMN "SPMS"."OVERSEA_REQUISITION_DTL"."WERKS" IS '工厂代码';
COMMENT ON COLUMN "SPMS"."OVERSEA_REQUISITION_DTL"."WORKSHOP_CODE" IS '车间代码';
COMMENT ON COLUMN "SPMS"."OVERSEA_REQUISITION_DTL"."WHS_LOCATION_CODE" IS '仓库地点代码';
COMMENT ON COLUMN "SPMS"."OVERSEA_REQUISITION_DTL"."MATERIAL_NO" IS '物料编号';
COMMENT ON COLUMN "SPMS"."OVERSEA_REQUISITION_DTL"."APPLY_QTY_BASIC_UNIT" IS '申请基本单位数量';
COMMENT ON COLUMN "SPMS"."OVERSEA_REQUISITION_DTL"."ACTUAL_QTY_BASIC_UNIT" IS '实际基本单位数量';
COMMENT ON COLUMN "SPMS"."OVERSEA_REQUISITION_DTL"."BASIC_UNIT" IS '基本单位';
COMMENT ON COLUMN "SPMS"."OVERSEA_REQUISITION_DTL"."APPLY_QTY_UNIT_SALES" IS '申请销售单位数量';
COMMENT ON COLUMN "SPMS"."OVERSEA_REQUISITION_DTL"."ACTUAL_QTY_UNIT_SALES" IS '实际销售单位数量';
COMMENT ON COLUMN "SPMS"."OVERSEA_REQUISITION_DTL"."UNIT_SALES" IS '销售单位';
COMMENT ON COLUMN "SPMS"."OVERSEA_REQUISITION_DTL"."REMARKS" IS '明细备注';
COMMENT ON COLUMN "SPMS"."OVERSEA_REQUISITION_DTL"."STORAGE_INFO" IS '储位信息';
COMMENT ON COLUMN "SPMS"."OVERSEA_REQUISITION_DTL"."MOVEMENT_TYPE" IS '申请物料移动类型';
COMMENT ON COLUMN "SPMS"."OVERSEA_REQUISITION_DTL"."ACTUAL_MOVEMENT_TYPE" IS '实际移动类型(生成出库任务时)';
COMMENT ON TABLE "SPMS"."OVERSEA_REQUISITION_DTL" IS '领用申请表明细';

-- ----------------------------
-- Table structure for OVERSEA_WHS_DUMP
-- ----------------------------
DROP TABLE "SPMS"."OVERSEA_WHS_DUMP";
CREATE TABLE "SPMS"."OVERSEA_WHS_DUMP" (
  "WHS_DUMP_UUID" VARCHAR2(32 BYTE) VISIBLE NOT NULL,
  "WHS_DUMP_NO" VARCHAR2(32 BYTE) VISIBLE,
  "WERKS_DUMP_IN" VARCHAR2(6 BYTE) VISIBLE,
  "WHS_LOCATION_CODE_DUMP_IN" VARCHAR2(6 BYTE) VISIBLE,
  "WERKS_DUMP_OUT" VARCHAR2(6 BYTE) VISIBLE,
  "WHS_LOCATION_CODE_DUMP_OUT" VARCHAR2(6 BYTE) VISIBLE,
  "CREATE_DATE" VARCHAR2(12 BYTE) VISIBLE,
  "SPMS_STATUS" VARCHAR2(2 BYTE) VISIBLE,
  "OA_WORKFLOW" VARCHAR2(16 BYTE) VISIBLE,
  "OA_BIANHAO" VARCHAR2(32 BYTE) VISIBLE,
  "OA_REMARK" VARCHAR2(255 BYTE) VISIBLE,
  "SUBMIT_OA_DATE" VARCHAR2(12 BYTE) VISIBLE,
  "OA_APPROVAL_DATE" VARCHAR2(12 BYTE) VISIBLE,
  "OA_FIELD" VARCHAR2(16 BYTE) VISIBLE,
  "DUMP_OUT_REMARK" VARCHAR2(255 BYTE) VISIBLE,
  "DUMP_OUT_DATE" VARCHAR2(12 BYTE) VISIBLE,
  "SAP_PURCHASE_NO" VARCHAR2(32 BYTE) VISIBLE,
  "PURCHASE_POSTING_DATE" VARCHAR2(16 BYTE) VISIBLE,
  "PURCHASE_VOUCHER_YEAR" VARCHAR2(8 BYTE) VISIBLE,
  "SAP_DELIVERY_NOTE" VARCHAR2(32 BYTE) VISIBLE,
  "POSTING_DATE" VARCHAR2(12 BYTE) VISIBLE,
  "SAP_VOUCHER_YEAR" VARCHAR2(8 BYTE) VISIBLE,
  "CANCEL_VOUCHER_NUMBER" VARCHAR2(32 BYTE) VISIBLE,
  "CANCEL_POSTING_DATE" VARCHAR2(12 BYTE) VISIBLE,
  "CANCEL_VOUCHER_YEAR" VARCHAR2(8 BYTE) VISIBLE,
  "BUSINESS_TYPE" VARCHAR2(16 BYTE) VISIBLE,
  "VOUCHER_TYPE" VARCHAR2(16 BYTE) VISIBLE,
  "PURCHASE_GROUP" VARCHAR2(16 BYTE) VISIBLE,
  "PURCHASE_ORG" VARCHAR2(16 BYTE) VISIBLE,
  "RETURN_MARK" VARCHAR2(16 BYTE) VISIBLE,
  "DELIVERY_DATE" VARCHAR2(16 BYTE) VISIBLE,
  "DELIVERY_TYPE" VARCHAR2(12 BYTE) VISIBLE,
  "MOVEMENT_TYPE" VARCHAR2(8 BYTE) VISIBLE,
  "COST_CENTER" VARCHAR2(8 BYTE) VISIBLE,
  "COMMENTS" VARCHAR2(32 BYTE) VISIBLE,
  "CREATE_USERID" VARCHAR2(12 BYTE) VISIBLE,
  "DATA_VERSION" NUMBER VISIBLE DEFAULT "SPMS"."DATA_VERSION"."NEXTVAL",
  "CREATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss'),
  "UPDATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss')
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_DUMP"."WHS_DUMP_UUID" IS '转储任务UUID';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_DUMP"."WHS_DUMP_NO" IS '转储任务单号';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_DUMP"."WERKS_DUMP_IN" IS '转入工厂代码';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_DUMP"."WHS_LOCATION_CODE_DUMP_IN" IS '转入仓库代码';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_DUMP"."WERKS_DUMP_OUT" IS '转出工厂代码';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_DUMP"."WHS_LOCATION_CODE_DUMP_OUT" IS '转出仓库代码';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_DUMP"."CREATE_DATE" IS '创建日期';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_DUMP"."SPMS_STATUS" IS '海外SPMS转储单据状态:0删除；1草稿；2待审批；3SPMS审批通过(提交OA);4OA驳回(操作同1);5OA审批通过(出库中);6出库完成;7提交SAP获取PO失败;8提交SAP获取PO;9提交SAP获取DN失败;10提交SAP获取DN成功(扣转出方库存);11转出已撤销(撤到状态5出库中，SAP撤回成功则加回库存);';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_DUMP"."OA_WORKFLOW" IS 'OA流程编号';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_DUMP"."OA_BIANHAO" IS 'OA单据编号';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_DUMP"."OA_REMARK" IS '提交OA审批备注';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_DUMP"."SUBMIT_OA_DATE" IS '提交OA日期';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_DUMP"."OA_APPROVAL_DATE" IS 'OA审批通过日期';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_DUMP"."OA_FIELD" IS 'OA预留字段';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_DUMP"."DUMP_OUT_REMARK" IS '转出备注信息';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_DUMP"."DUMP_OUT_DATE" IS '转出完成日期';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_DUMP"."SAP_PURCHASE_NO" IS 'SAP采购凭证号';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_DUMP"."PURCHASE_POSTING_DATE" IS '获取采购凭证号过账日期';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_DUMP"."PURCHASE_VOUCHER_YEAR" IS '采购凭证年份';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_DUMP"."SAP_DELIVERY_NOTE" IS 'SAP交货单号';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_DUMP"."POSTING_DATE" IS '获取交货单号采购凭证过账日期';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_DUMP"."SAP_VOUCHER_YEAR" IS '交货单凭证年份';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_DUMP"."CANCEL_VOUCHER_NUMBER" IS '撤销SAP凭证号';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_DUMP"."CANCEL_POSTING_DATE" IS '撤销SAP过账日期';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_DUMP"."CANCEL_VOUCHER_YEAR" IS '撤销SAP凭证年份';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_DUMP"."BUSINESS_TYPE" IS '业务标识';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_DUMP"."VOUCHER_TYPE" IS '凭证类型/订单类型(采购)公司内ZU01/公司间ZC01';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_DUMP"."PURCHASE_GROUP" IS '采购组-240';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_DUMP"."PURCHASE_ORG" IS '采购组织-1000';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_DUMP"."RETURN_MARK" IS '退货标识';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_DUMP"."DELIVERY_DATE" IS '项目交货日期/需求到货日期';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_DUMP"."DELIVERY_TYPE" IS '交货类型';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_DUMP"."MOVEMENT_TYPE" IS '移动类型';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_DUMP"."COST_CENTER" IS '成本中心';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_DUMP"."COMMENTS" IS '预留字段';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_DUMP"."CREATE_USERID" IS '创建人工号';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_DUMP"."DATA_VERSION" IS '数据版本号';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_DUMP"."CREATE_TIME" IS '创建时间';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_DUMP"."UPDATE_TIME" IS '更新时间';
COMMENT ON TABLE "SPMS"."OVERSEA_WHS_DUMP" IS '海外仓转储任务表';

-- ----------------------------
-- Table structure for OVERSEA_WHS_DUMP_DTL
-- ----------------------------
DROP TABLE "SPMS"."OVERSEA_WHS_DUMP_DTL";
CREATE TABLE "SPMS"."OVERSEA_WHS_DUMP_DTL" (
  "AUTO_ID_DUMP_DTL" NUMBER VISIBLE DEFAULT "SPMS"."OVERSEA_WHS_DUMP_DTL_SEQ"."NEXTVAL" NOT NULL,
  "WHS_DUMP_UUID" VARCHAR2(32 BYTE) VISIBLE,
  "ITEM" NUMBER VISIBLE,
  "MATERIAL_NO" VARCHAR2(32 BYTE) VISIBLE,
  "BASIC_UNIT" VARCHAR2(6 BYTE) VISIBLE,
  "UNIT_SALES" VARCHAR2(6 BYTE) VISIBLE,
  "APPLY_QTY_BASIC_UNIT" NUMBER VISIBLE,
  "APPLY_QTY_UNIT_SALES" NUMBER VISIBLE,
  "APPLY_REMARK" VARCHAR2(255 BYTE) VISIBLE,
  "ACTUAL_QTY_BASIC_UNIT" NUMBER VISIBLE,
  "ACTUAL_QTY_UNIT_SALES" NUMBER VISIBLE,
  "ACTUAL_STORAGE_INFO" VARCHAR2(2000 BYTE) VISIBLE,
  "ACTUAL_REMARK" VARCHAR2(255 BYTE) VISIBLE
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_DUMP_DTL"."AUTO_ID_DUMP_DTL" IS '海外转储明细自增ID';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_DUMP_DTL"."WHS_DUMP_UUID" IS '转储任务UUID';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_DUMP_DTL"."ITEM" IS '转储任务行号';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_DUMP_DTL"."MATERIAL_NO" IS '物料编号';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_DUMP_DTL"."BASIC_UNIT" IS '基本单位';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_DUMP_DTL"."UNIT_SALES" IS '销售单位';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_DUMP_DTL"."APPLY_QTY_BASIC_UNIT" IS '申请转出基本单位数量';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_DUMP_DTL"."APPLY_QTY_UNIT_SALES" IS '申请转出销售单位数量';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_DUMP_DTL"."APPLY_REMARK" IS '申请行备注信息';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_DUMP_DTL"."ACTUAL_QTY_BASIC_UNIT" IS '实际转出基本单位数量';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_DUMP_DTL"."ACTUAL_QTY_UNIT_SALES" IS '实际转出销售单位数量';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_DUMP_DTL"."ACTUAL_STORAGE_INFO" IS '实际转出储位信息';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_DUMP_DTL"."ACTUAL_REMARK" IS '实际转出行备注信息';
COMMENT ON TABLE "SPMS"."OVERSEA_WHS_DUMP_DTL" IS '海外转储任务明细表';

-- ----------------------------
-- Table structure for OVERSEA_WHS_IN
-- ----------------------------
DROP TABLE "SPMS"."OVERSEA_WHS_IN";
CREATE TABLE "SPMS"."OVERSEA_WHS_IN" (
  "UUID_WHS_IN" VARCHAR2(32 BYTE) VISIBLE NOT NULL,
  "WHS_IN_NO" VARCHAR2(32 BYTE) VISIBLE,
  "SAP_PACKAGE_LIST" VARCHAR2(16 BYTE) VISIBLE,
  "SAP_DELIVERY_NOTE" VARCHAR2(16 BYTE) VISIBLE,
  "WERKS" VARCHAR2(10 BYTE) VISIBLE,
  "WHS_LOCATION_CODE" VARCHAR2(10 BYTE) VISIBLE,
  "SPMS_STATUS" VARCHAR2(2 BYTE) VISIBLE DEFAULT '0',
  "CREATE_DATE" VARCHAR2(12 BYTE) VISIBLE,
  "CREATE_USERID" VARCHAR2(32 BYTE) VISIBLE,
  "REMARKS" VARCHAR2(255 BYTE) VISIBLE,
  "COMMENTS" VARCHAR2(255 BYTE) VISIBLE,
  "POSTING_DATE" VARCHAR2(16 BYTE) VISIBLE,
  "SAP_VOUCHER_NUMBER" VARCHAR2(32 BYTE) VISIBLE,
  "SAP_VOUCHER_YEAR" VARCHAR2(16 BYTE) VISIBLE,
  "CANCEL_POSTING_DATE" VARCHAR2(16 BYTE) VISIBLE,
  "CANCEL_VOUCHER_NUMBER" VARCHAR2(32 BYTE) VISIBLE,
  "CANCEL_VOUCHER_YEAR" VARCHAR2(16 BYTE) VISIBLE,
  "DATA_VERSION" NUMBER VISIBLE DEFAULT "SPMS"."DATA_VERSION"."NEXTVAL",
  "CREATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss'),
  "UPDATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss'),
  "CABINET_NUMBER" VARCHAR2(50 BYTE) VISIBLE
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_IN"."UUID_WHS_IN" IS '入库任务UUID';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_IN"."WHS_IN_NO" IS '入库任务单号';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_IN"."SAP_PACKAGE_LIST" IS '装箱单号';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_IN"."SAP_DELIVERY_NOTE" IS '交货单号';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_IN"."WERKS" IS '入库任务工厂';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_IN"."WHS_LOCATION_CODE" IS '入库任务仓库库存地点';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_IN"."SPMS_STATUS" IS '入库任务状态(默认0待入库;1入库中;2入库完成;3审批通过;4提交SAP成功;5提交SAP失败;6已撤销;7关闭;)';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_IN"."CREATE_DATE" IS '创建日期';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_IN"."CREATE_USERID" IS '创建人工号';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_IN"."REMARKS" IS '入库任务备注';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_IN"."COMMENTS" IS '入库任务评论';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_IN"."POSTING_DATE" IS '提交SAP过账日期';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_IN"."SAP_VOUCHER_NUMBER" IS 'SAP物料凭证号';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_IN"."SAP_VOUCHER_YEAR" IS 'SAP物料凭证年份';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_IN"."CANCEL_POSTING_DATE" IS '撤销提交SAP过账日期';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_IN"."CANCEL_VOUCHER_NUMBER" IS '撤销提交SAP物料凭证号';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_IN"."CANCEL_VOUCHER_YEAR" IS '撤销提交SAP物料凭证年份';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_IN"."DATA_VERSION" IS '数据版本号';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_IN"."CREATE_TIME" IS '创建时间';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_IN"."UPDATE_TIME" IS '更新时间';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_IN"."CABINET_NUMBER" IS '柜号';
COMMENT ON TABLE "SPMS"."OVERSEA_WHS_IN" IS '海外仓入库任务表头';

-- ----------------------------
-- Table structure for OVERSEA_WHS_IN_DTL
-- ----------------------------
DROP TABLE "SPMS"."OVERSEA_WHS_IN_DTL";
CREATE TABLE "SPMS"."OVERSEA_WHS_IN_DTL" (
  "AUTO_ID_WHS_IN_DTL" NUMBER VISIBLE DEFAULT "SPMS"."ITEM_AUTO_ID_SEQ"."NEXTVAL" NOT NULL,
  "UUID_WHS_IN" VARCHAR2(32 BYTE) VISIBLE,
  "ITEM" VARCHAR2(6 BYTE) VISIBLE,
  "MATERIAL_NO" VARCHAR2(32 BYTE) VISIBLE,
  "BASIC_UNIT" VARCHAR2(6 BYTE) VISIBLE,
  "UNIT_SALES" VARCHAR2(6 BYTE) VISIBLE,
  "RECEIVABLE_QTY_BASIC_UNIT" NUMBER VISIBLE,
  "RECEIVABLE_QTY_UNIT_SALES" NUMBER VISIBLE,
  "ACTUAL_QTY_BASIC_UNIT" NUMBER VISIBLE,
  "ACTUAL_QTY_UNIT_SALES" NUMBER VISIBLE,
  "STORAGE_INFO" VARCHAR2(2000 BYTE) VISIBLE,
  "ITEM_REMARKS" VARCHAR2(255 BYTE) VISIBLE,
  "SAP_DELIVERY_NOTE" VARCHAR2(16 BYTE) VISIBLE,
  "SAP_DELIVERY_NOTE_ITEM" VARCHAR2(6 BYTE) VISIBLE,
  "RECEIVABLE_WERKS" VARCHAR2(16 BYTE) VISIBLE,
  "RECEIVABLE_WHS_LOCATION_CODE" VARCHAR2(16 BYTE) VISIBLE,
  "ACTUAL_WERKS" VARCHAR2(16 BYTE) VISIBLE,
  "ACTUAL_WHS_LOCATION_CODE" VARCHAR2(16 BYTE) VISIBLE,
  "BOX_NOTE" VARCHAR2(50 BYTE) VISIBLE,
  "BOX_NOTE_ITEM" VARCHAR2(6 BYTE) VISIBLE
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_IN_DTL"."AUTO_ID_WHS_IN_DTL" IS '入库任务明细自增ID';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_IN_DTL"."UUID_WHS_IN" IS '入库任务UUID';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_IN_DTL"."ITEM" IS '入库任务行号';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_IN_DTL"."MATERIAL_NO" IS '物料编号';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_IN_DTL"."BASIC_UNIT" IS '基本单位';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_IN_DTL"."UNIT_SALES" IS '销售单位';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_IN_DTL"."RECEIVABLE_QTY_BASIC_UNIT" IS '应收基本单位数量';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_IN_DTL"."RECEIVABLE_QTY_UNIT_SALES" IS '应收销售单位数量';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_IN_DTL"."ACTUAL_QTY_BASIC_UNIT" IS '实收基本单位数量';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_IN_DTL"."ACTUAL_QTY_UNIT_SALES" IS '实收销售单位数量';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_IN_DTL"."STORAGE_INFO" IS '储位信息';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_IN_DTL"."ITEM_REMARKS" IS 'SPMS行项目备注';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_IN_DTL"."SAP_DELIVERY_NOTE" IS '交货单号';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_IN_DTL"."SAP_DELIVERY_NOTE_ITEM" IS '交货单行号';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_IN_DTL"."RECEIVABLE_WERKS" IS '收货工厂——应收';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_IN_DTL"."RECEIVABLE_WHS_LOCATION_CODE" IS '收货库存地点——应收';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_IN_DTL"."ACTUAL_WERKS" IS '收货工厂——实收';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_IN_DTL"."ACTUAL_WHS_LOCATION_CODE" IS '收货库存地点——实收';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_IN_DTL"."BOX_NOTE" IS '箱码';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_IN_DTL"."BOX_NOTE_ITEM" IS '箱码明细行号';
COMMENT ON TABLE "SPMS"."OVERSEA_WHS_IN_DTL" IS '海外仓入库任务明细';

-- ----------------------------
-- Table structure for OVERSEA_WHS_MOVE
-- ----------------------------
DROP TABLE "SPMS"."OVERSEA_WHS_MOVE";
CREATE TABLE "SPMS"."OVERSEA_WHS_MOVE" (
  "UUID" VARCHAR2(32 BYTE) VISIBLE NOT NULL,
  "WHS_MOVE_NO" VARCHAR2(32 BYTE) VISIBLE,
  "SUBJECT" VARCHAR2(255 BYTE) VISIBLE,
  "CREATE_DATE" VARCHAR2(16 BYTE) VISIBLE,
  "SPMS_STATUS" VARCHAR2(2 BYTE) VISIBLE DEFAULT '1',
  "MOVEMENT_TYPE" VARCHAR2(6 BYTE) VISIBLE,
  "WERKS_MOVE_OUT" VARCHAR2(12 BYTE) VISIBLE,
  "WHS_LOCATION_CODE_MOVE_OUT" VARCHAR2(12 BYTE) VISIBLE,
  "REMARK_MOVE_OUT" VARCHAR2(1000 BYTE) VISIBLE,
  "WERKS_MOVE_IN" VARCHAR2(12 BYTE) VISIBLE,
  "WHS_LOCATION_CODE_MOVE_IN" VARCHAR2(12 BYTE) VISIBLE,
  "REMARK_MOVE_IN" VARCHAR2(1000 BYTE) VISIBLE,
  "RELATE_DOCUMENT" VARCHAR2(32 BYTE) VISIBLE,
  "REMARKS" VARCHAR2(255 BYTE) VISIBLE,
  "COMMENTS" VARCHAR2(255 BYTE) VISIBLE,
  "POSTING_DATE" VARCHAR2(16 BYTE) VISIBLE,
  "SAP_VOUCHER_NUMBER" VARCHAR2(32 BYTE) VISIBLE,
  "SAP_VOUCHER_YEAR" VARCHAR2(8 BYTE) VISIBLE,
  "CANCEL_POSTING_DATE" VARCHAR2(16 BYTE) VISIBLE,
  "CANCEL_VOUCHER_NUMBER" VARCHAR2(32 BYTE) VISIBLE,
  "CANCEL_VOUCHER_YEAR" VARCHAR2(8 BYTE) VISIBLE,
  "CREATE_USERID" VARCHAR2(32 BYTE) VISIBLE,
  "DATA_VERSION" NUMBER VISIBLE DEFAULT "SPMS"."DATA_VERSION"."NEXTVAL",
  "CREATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss'),
  "UPDATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss')
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_MOVE"."UUID" IS '调拨任务UUID';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_MOVE"."WHS_MOVE_NO" IS '调拨任务单号';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_MOVE"."SUBJECT" IS '标题';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_MOVE"."CREATE_DATE" IS '创建日期';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_MOVE"."SPMS_STATUS" IS '调拨任务状态(0删除;1保存;2提交SPMS/库存更新;3提交SAP失败;4提交SAP成功;5调拨任务已撤销;)';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_MOVE"."MOVEMENT_TYPE" IS '移动类型';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_MOVE"."WERKS_MOVE_OUT" IS '调拨调出工厂代码';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_MOVE"."WHS_LOCATION_CODE_MOVE_OUT" IS '调拨调出仓库代码';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_MOVE"."REMARK_MOVE_OUT" IS '调拨调出备注';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_MOVE"."WERKS_MOVE_IN" IS '调拨调入工厂代码';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_MOVE"."WHS_LOCATION_CODE_MOVE_IN" IS '调拨调入仓库代码';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_MOVE"."REMARK_MOVE_IN" IS '调拨调入备注';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_MOVE"."RELATE_DOCUMENT" IS '关联单据号';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_MOVE"."REMARKS" IS '备注/预留';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_MOVE"."COMMENTS" IS '评论/预留';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_MOVE"."POSTING_DATE" IS '过账日期';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_MOVE"."SAP_VOUCHER_NUMBER" IS 'SAP凭证号';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_MOVE"."SAP_VOUCHER_YEAR" IS 'SAP过账年份';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_MOVE"."CANCEL_POSTING_DATE" IS '撤销SAP过账日期';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_MOVE"."CANCEL_VOUCHER_NUMBER" IS '撤销SAP凭证';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_MOVE"."CANCEL_VOUCHER_YEAR" IS '撤销SAP凭证年份';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_MOVE"."CREATE_USERID" IS '创建人工号';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_MOVE"."DATA_VERSION" IS '数据版本号';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_MOVE"."CREATE_TIME" IS '创建时间';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_MOVE"."UPDATE_TIME" IS '更新时间';
COMMENT ON TABLE "SPMS"."OVERSEA_WHS_MOVE" IS '海外仓调拨业务';

-- ----------------------------
-- Table structure for OVERSEA_WHS_MOVE_DTL
-- ----------------------------
DROP TABLE "SPMS"."OVERSEA_WHS_MOVE_DTL";
CREATE TABLE "SPMS"."OVERSEA_WHS_MOVE_DTL" (
  "UUID" VARCHAR2(32 BYTE) VISIBLE,
  "ITEM_NO" VARCHAR2(6 BYTE) VISIBLE,
  "MATERIAL_NO" VARCHAR2(32 BYTE) VISIBLE,
  "QTY_MOVE_OUT" NUMBER VISIBLE DEFAULT 0,
  "STORAGE_INFO_MOVE_OUT" VARCHAR2(2000 BYTE) VISIBLE DEFAULT '[]',
  "ACTUAL_QTY_MOVE_OUT" NUMBER VISIBLE DEFAULT 0,
  "ACTUAL_STORAGE_INFO_MOVE_OUT" VARCHAR2(2000 BYTE) VISIBLE DEFAULT '[]',
  "REMARK_MOVE_OUT" VARCHAR2(255 BYTE) VISIBLE,
  "ACTUAL_QTY_MOVE_IN" NUMBER VISIBLE DEFAULT 0,
  "ACTUAL_STORAGE_INFO_MOVE_IN" VARCHAR2(2000 BYTE) VISIBLE DEFAULT '[]',
  "REMARK_MOVE_IN" VARCHAR2(255 BYTE) VISIBLE,
  "SUPPLIER_NO" VARCHAR2(16 BYTE) VISIBLE,
  "COST_CENTER" VARCHAR2(16 BYTE) VISIBLE,
  "REMARKS" VARCHAR2(255 BYTE) VISIBLE,
  "COMMENTS" VARCHAR2(255 BYTE) VISIBLE
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_MOVE_DTL"."UUID" IS '调拨任务UUID';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_MOVE_DTL"."ITEM_NO" IS '调拨明细行号';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_MOVE_DTL"."MATERIAL_NO" IS '物料编号';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_MOVE_DTL"."QTY_MOVE_OUT" IS '计划调拨调出数量';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_MOVE_DTL"."STORAGE_INFO_MOVE_OUT" IS '计划调拨调出储位信息';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_MOVE_DTL"."ACTUAL_QTY_MOVE_OUT" IS '实际调拨调出数量';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_MOVE_DTL"."ACTUAL_STORAGE_INFO_MOVE_OUT" IS '实际调拨调出储位信息';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_MOVE_DTL"."REMARK_MOVE_OUT" IS '调拨调出备注';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_MOVE_DTL"."ACTUAL_QTY_MOVE_IN" IS '实际调拨调入数量';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_MOVE_DTL"."ACTUAL_STORAGE_INFO_MOVE_IN" IS '实际调拨调入储位信息';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_MOVE_DTL"."REMARK_MOVE_IN" IS '调拨调入备注';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_MOVE_DTL"."SUPPLIER_NO" IS '供应商账号';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_MOVE_DTL"."COST_CENTER" IS '成本中心';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_MOVE_DTL"."REMARKS" IS '备注/预留';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_MOVE_DTL"."COMMENTS" IS '评论/预留';
COMMENT ON TABLE "SPMS"."OVERSEA_WHS_MOVE_DTL" IS '海外仓调拨任务明细';

-- ----------------------------
-- Table structure for OVERSEA_WHS_OUT
-- ----------------------------
DROP TABLE "SPMS"."OVERSEA_WHS_OUT";
CREATE TABLE "SPMS"."OVERSEA_WHS_OUT" (
  "AUTO_ID_WHS_OUT" NUMBER VISIBLE DEFAULT "SPMS"."OVERSEA_WHS_OUT_SEQ"."NEXTVAL",
  "UUID_WHS_OUT" VARCHAR2(32 BYTE) VISIBLE NOT NULL,
  "SPMS_ID" VARCHAR2(32 BYTE) VISIBLE,
  "CREATE_DATE" VARCHAR2(16 BYTE) VISIBLE,
  "MOVEMENT_TYPE" VARCHAR2(32 BYTE) VISIBLE,
  "SPMS_STATUS" VARCHAR2(2 BYTE) VISIBLE DEFAULT '1',
  "CREATE_USERID" VARCHAR2(16 BYTE) VISIBLE,
  "WERKS" VARCHAR2(16 BYTE) VISIBLE,
  "WORKSHOP_CODE" VARCHAR2(16 BYTE) VISIBLE,
  "WHS_LOCATION_CODE" VARCHAR2(16 BYTE) VISIBLE,
  "RELATE_DOCUMENT" VARCHAR2(32 BYTE) VISIBLE,
  "COST_CENTER" VARCHAR2(32 BYTE) VISIBLE,
  "DATA_VERSION" NUMBER VISIBLE DEFAULT "SPMS"."DATA_VERSION"."NEXTVAL",
  "REMARKS" VARCHAR2(255 BYTE) VISIBLE,
  "COMMENTS" VARCHAR2(255 BYTE) VISIBLE,
  "POSTING_DATE" VARCHAR2(16 BYTE) VISIBLE,
  "SAP_VOUCHER_NUMBER" VARCHAR2(32 BYTE) VISIBLE,
  "SAP_VOUCHER_YEAR" VARCHAR2(16 BYTE) VISIBLE,
  "CANCEL_POSTING_DATE" VARCHAR2(16 BYTE) VISIBLE,
  "SAP_CANCEL_VOUCHER_NUMBER" VARCHAR2(32 BYTE) VISIBLE,
  "SAP_CANCEL_VOUCHER_YEAR" VARCHAR2(16 BYTE) VISIBLE,
  "CREATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss'),
  "UPDATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss'),
  "COST_CENTER_NAME" VARCHAR2(255 BYTE) VISIBLE
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_OUT"."AUTO_ID_WHS_OUT" IS '出库任务表自增ID';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_OUT"."UUID_WHS_OUT" IS '出库任务UUID';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_OUT"."SPMS_ID" IS '出库任务单号';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_OUT"."CREATE_DATE" IS '创建日期';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_OUT"."MOVEMENT_TYPE" IS '移动类型';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_OUT"."SPMS_STATUS" IS '单据状态(0已删除;1出库中;2出库完成;3提交SAP成功;4提交SAP失败;5已撤销;)';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_OUT"."CREATE_USERID" IS '创建人';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_OUT"."WERKS" IS '工厂代码';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_OUT"."WORKSHOP_CODE" IS '车间代码';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_OUT"."WHS_LOCATION_CODE" IS '仓库地点代码';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_OUT"."RELATE_DOCUMENT" IS '来源单号/关联单据号';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_OUT"."COST_CENTER" IS '成本中心';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_OUT"."DATA_VERSION" IS '数据版本号';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_OUT"."REMARKS" IS '备注';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_OUT"."COMMENTS" IS '评论/出库申请标题';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_OUT"."POSTING_DATE" IS 'SAP过账日期';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_OUT"."SAP_VOUCHER_NUMBER" IS 'SAP物料凭证';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_OUT"."SAP_VOUCHER_YEAR" IS 'SAP物料凭证年份';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_OUT"."CANCEL_POSTING_DATE" IS 'SAP撤销过账日期';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_OUT"."SAP_CANCEL_VOUCHER_NUMBER" IS 'SAP撤销凭证';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_OUT"."SAP_CANCEL_VOUCHER_YEAR" IS 'SAP撤销凭证年份';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_OUT"."CREATE_TIME" IS '创建时间';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_OUT"."UPDATE_TIME" IS '更新时间';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_OUT"."COST_CENTER_NAME" IS '成本中心名称';
COMMENT ON TABLE "SPMS"."OVERSEA_WHS_OUT" IS '海外出库任务表';

-- ----------------------------
-- Table structure for OVERSEA_WHS_OUT_DTL
-- ----------------------------
DROP TABLE "SPMS"."OVERSEA_WHS_OUT_DTL";
CREATE TABLE "SPMS"."OVERSEA_WHS_OUT_DTL" (
  "AUTO_ID_WHS_OUT_DTL" NUMBER VISIBLE DEFAULT "SPMS"."OVERSEA_WHS_OUT_DTL_SEQ"."NEXTVAL" NOT NULL,
  "UUID_WHS_OUT" VARCHAR2(32 BYTE) VISIBLE,
  "ITEM" NUMBER VISIBLE,
  "WERKS" VARCHAR2(16 BYTE) VISIBLE,
  "WORKSHOP_CODE" VARCHAR2(16 BYTE) VISIBLE,
  "WHS_LOCATION_CODE" VARCHAR2(16 BYTE) VISIBLE,
  "MATERIAL_NO" VARCHAR2(32 BYTE) VISIBLE,
  "ISSUE_QTY_BASIC_UNIT" NUMBER VISIBLE,
  "ACTUAL_QTY_BASIC_UNIT" NUMBER VISIBLE,
  "BASIC_UNIT" VARCHAR2(6 BYTE) VISIBLE,
  "ISSUE_QTY_UNIT_SALES" NUMBER VISIBLE,
  "ACTUAL_QTY_UNIT_SALES" NUMBER VISIBLE,
  "UNIT_SALES" VARCHAR2(6 BYTE) VISIBLE,
  "REMARKS" VARCHAR2(255 BYTE) VISIBLE,
  "STORAGE_INFO" VARCHAR2(2000 BYTE) VISIBLE,
  "MOVEMENT_TYPE" VARCHAR2(10 BYTE) VISIBLE,
  "RELATE_DOCUMENT" VARCHAR2(32 BYTE) VISIBLE,
  "RELATE_DOCUMENT_ITEM" VARCHAR2(6 BYTE) VISIBLE
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_OUT_DTL"."AUTO_ID_WHS_OUT_DTL" IS '出库任务表明细自增ID';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_OUT_DTL"."UUID_WHS_OUT" IS '出库任务UUID';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_OUT_DTL"."ITEM" IS '明细行号';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_OUT_DTL"."WERKS" IS '工厂代码';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_OUT_DTL"."WORKSHOP_CODE" IS '车间代码';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_OUT_DTL"."WHS_LOCATION_CODE" IS '仓库地点代码';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_OUT_DTL"."MATERIAL_NO" IS '物料编号';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_OUT_DTL"."ISSUE_QTY_BASIC_UNIT" IS '应出基本单位数量';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_OUT_DTL"."ACTUAL_QTY_BASIC_UNIT" IS '实际基本单位数量';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_OUT_DTL"."BASIC_UNIT" IS '基本单位';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_OUT_DTL"."ISSUE_QTY_UNIT_SALES" IS '应出销售单位数量';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_OUT_DTL"."ACTUAL_QTY_UNIT_SALES" IS '实际销售单位数量';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_OUT_DTL"."UNIT_SALES" IS '销售单位';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_OUT_DTL"."REMARKS" IS '明细备注';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_OUT_DTL"."STORAGE_INFO" IS '储位信息';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_OUT_DTL"."MOVEMENT_TYPE" IS '物料移动类型';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_OUT_DTL"."RELATE_DOCUMENT" IS '关联单号/领用申请单号';
COMMENT ON COLUMN "SPMS"."OVERSEA_WHS_OUT_DTL"."RELATE_DOCUMENT_ITEM" IS '关联单号/领用申请单号明细行号';
COMMENT ON TABLE "SPMS"."OVERSEA_WHS_OUT_DTL" IS '出库任务表明细';

-- ----------------------------
-- Table structure for PURCHASE_PATTERN
-- ----------------------------
DROP TABLE "SPMS"."PURCHASE_PATTERN";
CREATE TABLE "SPMS"."PURCHASE_PATTERN" (
  "PATTERN_ID" VARCHAR2(64 BYTE) VISIBLE NOT NULL,
  "PATTERN_NAME" VARCHAR2(256 BYTE) VISIBLE,
  "WERKS" VARCHAR2(64 BYTE) VISIBLE,
  "PATTERN_DESC" VARCHAR2(1024 BYTE) VISIBLE,
  "IS_DELETED" VARCHAR2(4 BYTE) VISIBLE,
  "MACHINE_ID" VARCHAR2(64 BYTE) VISIBLE,
  "REMARK" VARCHAR2(512 BYTE) VISIBLE,
  "UPDATE_DATE" DATE VISIBLE DEFAULT NULL,
  "CREATE_DATE" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss')
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."PURCHASE_PATTERN"."PATTERN_ID" IS '场景编号';
COMMENT ON COLUMN "SPMS"."PURCHASE_PATTERN"."PATTERN_NAME" IS '请购场景名称';
COMMENT ON COLUMN "SPMS"."PURCHASE_PATTERN"."WERKS" IS '工厂编号';
COMMENT ON COLUMN "SPMS"."PURCHASE_PATTERN"."PATTERN_DESC" IS '请购场景描述';
COMMENT ON COLUMN "SPMS"."PURCHASE_PATTERN"."IS_DELETED" IS '是否删除，1是，0否，默认0';
COMMENT ON COLUMN "SPMS"."PURCHASE_PATTERN"."MACHINE_ID" IS '关联设备编号';
COMMENT ON COLUMN "SPMS"."PURCHASE_PATTERN"."REMARK" IS '备注信息';
COMMENT ON COLUMN "SPMS"."PURCHASE_PATTERN"."UPDATE_DATE" IS '单据更新系统时间戳';
COMMENT ON COLUMN "SPMS"."PURCHASE_PATTERN"."CREATE_DATE" IS '单据创建系统时间戳';
COMMENT ON TABLE "SPMS"."PURCHASE_PATTERN" IS '请购场景表';

-- ----------------------------
-- Table structure for PURCHASE_PATTERN_DTL
-- ----------------------------
DROP TABLE "SPMS"."PURCHASE_PATTERN_DTL";
CREATE TABLE "SPMS"."PURCHASE_PATTERN_DTL" (
  "PATTERN_ID" VARCHAR2(64 BYTE) VISIBLE,
  "ROW_ID" NUMBER VISIBLE,
  "MATERIAL_NO" VARCHAR2(128 BYTE) VISIBLE,
  "MATERIAL_ZH_DESC" VARCHAR2(256 BYTE) VISIBLE,
  "MATERIAL_EN_DESC" VARCHAR2(256 BYTE) VISIBLE,
  "REQUEST_QTY" NUMBER VISIBLE,
  "BASIC_UNIT" VARCHAR2(128 BYTE) VISIBLE,
  "BRAND" VARCHAR2(128 BYTE) VISIBLE,
  "ROW_STATUS" VARCHAR2(32 BYTE) VISIBLE,
  "ROW_COMMENT" VARCHAR2(1024 BYTE) VISIBLE,
  "DEVICE_ID" VARCHAR2(128 BYTE) VISIBLE,
  "DEVICE_CATEGORY" VARCHAR2(128 BYTE) VISIBLE,
  "DEVICE_TYPE" VARCHAR2(32 BYTE) VISIBLE,
  "MATERIAL_CATEGORY" VARCHAR2(128 BYTE) VISIBLE
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."PURCHASE_PATTERN_DTL"."PATTERN_ID" IS '场景请购单号';
COMMENT ON COLUMN "SPMS"."PURCHASE_PATTERN_DTL"."ROW_ID" IS '场景请购单行号';
COMMENT ON COLUMN "SPMS"."PURCHASE_PATTERN_DTL"."MATERIAL_NO" IS '物料编号';
COMMENT ON COLUMN "SPMS"."PURCHASE_PATTERN_DTL"."MATERIAL_ZH_DESC" IS '物料描述中文';
COMMENT ON COLUMN "SPMS"."PURCHASE_PATTERN_DTL"."MATERIAL_EN_DESC" IS '物料描述英文';
COMMENT ON COLUMN "SPMS"."PURCHASE_PATTERN_DTL"."REQUEST_QTY" IS '数量';
COMMENT ON COLUMN "SPMS"."PURCHASE_PATTERN_DTL"."BASIC_UNIT" IS '基本单位';
COMMENT ON COLUMN "SPMS"."PURCHASE_PATTERN_DTL"."BRAND" IS '品牌';
COMMENT ON COLUMN "SPMS"."PURCHASE_PATTERN_DTL"."ROW_STATUS" IS '行项目状态';
COMMENT ON COLUMN "SPMS"."PURCHASE_PATTERN_DTL"."ROW_COMMENT" IS '行项目备注';
COMMENT ON COLUMN "SPMS"."PURCHASE_PATTERN_DTL"."DEVICE_ID" IS '需求匹配的设备编码';
COMMENT ON COLUMN "SPMS"."PURCHASE_PATTERN_DTL"."DEVICE_CATEGORY" IS '设备/物料类别，3备品备件；4行政物资；5工厂设备；6筹建物资';
COMMENT ON COLUMN "SPMS"."PURCHASE_PATTERN_DTL"."DEVICE_TYPE" IS '设备类型,0实验室设备；生产设备';
COMMENT ON COLUMN "SPMS"."PURCHASE_PATTERN_DTL"."MATERIAL_CATEGORY" IS '物料类别';
COMMENT ON TABLE "SPMS"."PURCHASE_PATTERN_DTL" IS '场景请购单详情表';

-- ----------------------------
-- Table structure for SAFETY_INVENTORY
-- ----------------------------
DROP TABLE "SPMS"."SAFETY_INVENTORY";
CREATE TABLE "SPMS"."SAFETY_INVENTORY" (
  "UUID" VARCHAR2(32 BYTE) VISIBLE NOT NULL,
  "WERKS" VARCHAR2(6 BYTE) VISIBLE,
  "MATERIAL_NO" VARCHAR2(32 BYTE) VISIBLE,
  "BASIC_UNIT" VARCHAR2(6 BYTE) VISIBLE,
  "SAFETY_QTY_BASIC_UNIT" NUMBER VISIBLE DEFAULT 0,
  "SPMS_STATUS" VARCHAR2(2 BYTE) VISIBLE DEFAULT '1',
  "STANDARD_CONSUMPTION_LAST_YEAR" NUMBER VISIBLE DEFAULT 0,
  "SAFETY_INVENTORY_YEAR" NUMBER VISIBLE DEFAULT 0.5,
  "EMERGENCY_RESERVE_BASIC_UNIT" NUMBER VISIBLE DEFAULT 0,
  "REMARKS" VARCHAR2(255 BYTE) VISIBLE,
  "COMMENTS" VARCHAR2(255 BYTE) VISIBLE,
  "DATA_VERSION" NUMBER VISIBLE DEFAULT "SPMS"."DATA_VERSION"."NEXTVAL",
  "CREATE_USERID" VARCHAR2(32 BYTE) VISIBLE,
  "UPDATE_USERID" VARCHAR2(32 BYTE) VISIBLE,
  "CREATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss'),
  "UPDATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss'),
  "WHS_LOCATION_CODE" VARCHAR2(12 BYTE) VISIBLE
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."SAFETY_INVENTORY"."UUID" IS 'UUID唯一主键';
COMMENT ON COLUMN "SPMS"."SAFETY_INVENTORY"."WERKS" IS '工厂代码';
COMMENT ON COLUMN "SPMS"."SAFETY_INVENTORY"."MATERIAL_NO" IS '物料编号';
COMMENT ON COLUMN "SPMS"."SAFETY_INVENTORY"."BASIC_UNIT" IS '基本单位';
COMMENT ON COLUMN "SPMS"."SAFETY_INVENTORY"."SAFETY_QTY_BASIC_UNIT" IS '安全库存基本单位数量';
COMMENT ON COLUMN "SPMS"."SAFETY_INVENTORY"."SPMS_STATUS" IS '安全库存数据状态,默认1有效,0无效';
COMMENT ON COLUMN "SPMS"."SAFETY_INVENTORY"."STANDARD_CONSUMPTION_LAST_YEAR" IS '上年度标准耗用量';
COMMENT ON COLUMN "SPMS"."SAFETY_INVENTORY"."SAFETY_INVENTORY_YEAR" IS '安全库存年数(默认0.5年)';
COMMENT ON COLUMN "SPMS"."SAFETY_INVENTORY"."EMERGENCY_RESERVE_BASIC_UNIT" IS '应急储备量(基本单位)';
COMMENT ON COLUMN "SPMS"."SAFETY_INVENTORY"."REMARKS" IS '备注';
COMMENT ON COLUMN "SPMS"."SAFETY_INVENTORY"."COMMENTS" IS '评论/预留';
COMMENT ON COLUMN "SPMS"."SAFETY_INVENTORY"."DATA_VERSION" IS '数据版本号';
COMMENT ON COLUMN "SPMS"."SAFETY_INVENTORY"."CREATE_USERID" IS '创建人工号';
COMMENT ON COLUMN "SPMS"."SAFETY_INVENTORY"."UPDATE_USERID" IS '更新人工号';
COMMENT ON COLUMN "SPMS"."SAFETY_INVENTORY"."CREATE_TIME" IS '创建时间';
COMMENT ON COLUMN "SPMS"."SAFETY_INVENTORY"."UPDATE_TIME" IS '更新时间';
COMMENT ON COLUMN "SPMS"."SAFETY_INVENTORY"."WHS_LOCATION_CODE" IS '仓库地点代码';
COMMENT ON TABLE "SPMS"."SAFETY_INVENTORY" IS '安全库存表';

-- ----------------------------
-- Table structure for SAP_BOX_NOTE
-- ----------------------------
DROP TABLE "SPMS"."SAP_BOX_NOTE";
CREATE TABLE "SPMS"."SAP_BOX_NOTE" (
  "PACKAGE_NOTE" VARCHAR2(50 BYTE) VISIBLE,
  "BOX_NOTE" VARCHAR2(50 BYTE) VISIBLE NOT NULL,
  "BOX_MATERIAL_NAME" VARCHAR2(50 BYTE) VISIBLE,
  "TOTAL_QTY" NUMBER VISIBLE,
  "BOX_GROSS_WEIGHT" NUMBER(13,3) VISIBLE,
  "BOX_VOLUME" NUMBER(13,3) VISIBLE,
  "BOX_LENGTH" NUMBER(13,3) VISIBLE,
  "BOX_WIDTH" NUMBER(13,3) VISIBLE,
  "BOX_HEIGHT" NUMBER(13,3) VISIBLE,
  "BOX_COLOR" VARCHAR2(128 BYTE) VISIBLE,
  "BOX_QTY_RECEIVED" NUMBER VISIBLE,
  "ITEM_STATUS" VARCHAR2(2 BYTE) VISIBLE DEFAULT 0,
  "REMARKS" VARCHAR2(255 BYTE) VISIBLE,
  "CREATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss'),
  "ARRIVAL_DATE" VARCHAR2(16 BYTE) VISIBLE DEFAULT TO_CHAR(SYSDATE, 'yyyy-mm-dd'),
  "PARENT_BOX_NOTE" VARCHAR2(255 BYTE) VISIBLE
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."SAP_BOX_NOTE"."PACKAGE_NOTE" IS '包装单号';
COMMENT ON COLUMN "SPMS"."SAP_BOX_NOTE"."BOX_NOTE" IS '箱码/包装码';
COMMENT ON COLUMN "SPMS"."SAP_BOX_NOTE"."BOX_MATERIAL_NAME" IS '外箱材质名称';
COMMENT ON COLUMN "SPMS"."SAP_BOX_NOTE"."TOTAL_QTY" IS '装箱明细总数';
COMMENT ON COLUMN "SPMS"."SAP_BOX_NOTE"."BOX_GROSS_WEIGHT" IS '箱毛重(KG)';
COMMENT ON COLUMN "SPMS"."SAP_BOX_NOTE"."BOX_VOLUME" IS '箱体积(CCM)';
COMMENT ON COLUMN "SPMS"."SAP_BOX_NOTE"."BOX_LENGTH" IS '长(CM)';
COMMENT ON COLUMN "SPMS"."SAP_BOX_NOTE"."BOX_WIDTH" IS '宽(CM)';
COMMENT ON COLUMN "SPMS"."SAP_BOX_NOTE"."BOX_HEIGHT" IS '高(CM)';
COMMENT ON COLUMN "SPMS"."SAP_BOX_NOTE"."BOX_COLOR" IS '颜色';
COMMENT ON COLUMN "SPMS"."SAP_BOX_NOTE"."BOX_QTY_RECEIVED" IS '箱码-实收箱数/备件货';
COMMENT ON COLUMN "SPMS"."SAP_BOX_NOTE"."ITEM_STATUS" IS '箱码表状态信息';
COMMENT ON COLUMN "SPMS"."SAP_BOX_NOTE"."REMARKS" IS '箱码备注信息';
COMMENT ON COLUMN "SPMS"."SAP_BOX_NOTE"."CREATE_TIME" IS 'SPMS创建时间';
COMMENT ON COLUMN "SPMS"."SAP_BOX_NOTE"."ARRIVAL_DATE" IS '国内仓到货日期-库龄，数据创建默认给系统日期';
COMMENT ON COLUMN "SPMS"."SAP_BOX_NOTE"."PARENT_BOX_NOTE" IS '父箱箱码(拆箱,子箱存父箱箱码)';
COMMENT ON TABLE "SPMS"."SAP_BOX_NOTE" IS '箱码信息表';

-- ----------------------------
-- Table structure for SAP_BOX_NOTE_DTL
-- ----------------------------
DROP TABLE "SPMS"."SAP_BOX_NOTE_DTL";
CREATE TABLE "SPMS"."SAP_BOX_NOTE_DTL" (
  "PACKAGE_NOTE" VARCHAR2(50 BYTE) VISIBLE,
  "ITEM" NUMBER VISIBLE,
  "BOX_NOTE" VARCHAR2(50 BYTE) VISIBLE,
  "PACKAGE_POSNR" NUMBER VISIBLE,
  "MATERIAL_NO" VARCHAR2(18 BYTE) VISIBLE,
  "SPECS" VARCHAR2(128 BYTE) VISIBLE,
  "QUANTITY" NUMBER(13,3) VISIBLE,
  "BASIC_UNIT" VARCHAR2(3 BYTE) VISIBLE,
  "SRM_CONTRACT_NO" VARCHAR2(64 BYTE) VISIBLE,
  "PURCHASE_NO" VARCHAR2(64 BYTE) VISIBLE,
  "PURCHASE_NO_ITEM" NUMBER VISIBLE,
  "DELIVERY_NOTE_SAP" VARCHAR2(16 BYTE) VISIBLE,
  "DELIVERY_NOTE_SAP_ITEM" NUMBER VISIBLE,
  "DEMAND_NO" VARCHAR2(32 BYTE) VISIBLE,
  "DEMAND_NO_ITEM" NUMBER VISIBLE,
  "DEMANDER" VARCHAR2(64 BYTE) VISIBLE,
  "REMARK" VARCHAR2(128 BYTE) VISIBLE,
  "GROSS_WEIGHT" NUMBER(13,3) VISIBLE,
  "NET_WEIGHT" NUMBER(13,3) VISIBLE,
  "DOMESTIC_QTY_RECEIVABLE" NUMBER(13,3) VISIBLE,
  "DOMESTIC_QTY_RECEIVED" NUMBER(13,3) VISIBLE,
  "OVERSEA_QTY_RECEIVED" NUMBER(13,3) VISIBLE,
  "CREATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss')
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."SAP_BOX_NOTE_DTL"."PACKAGE_NOTE" IS '包装单号';
COMMENT ON COLUMN "SPMS"."SAP_BOX_NOTE_DTL"."ITEM" IS '序号';
COMMENT ON COLUMN "SPMS"."SAP_BOX_NOTE_DTL"."BOX_NOTE" IS '箱码/包装码';
COMMENT ON COLUMN "SPMS"."SAP_BOX_NOTE_DTL"."PACKAGE_POSNR" IS '包装号';
COMMENT ON COLUMN "SPMS"."SAP_BOX_NOTE_DTL"."MATERIAL_NO" IS '物料号';
COMMENT ON COLUMN "SPMS"."SAP_BOX_NOTE_DTL"."SPECS" IS '规格型号';
COMMENT ON COLUMN "SPMS"."SAP_BOX_NOTE_DTL"."QUANTITY" IS '数量';
COMMENT ON COLUMN "SPMS"."SAP_BOX_NOTE_DTL"."BASIC_UNIT" IS '基本计量单位';
COMMENT ON COLUMN "SPMS"."SAP_BOX_NOTE_DTL"."SRM_CONTRACT_NO" IS 'SRM合同号';
COMMENT ON COLUMN "SPMS"."SAP_BOX_NOTE_DTL"."PURCHASE_NO" IS '采购凭证号';
COMMENT ON COLUMN "SPMS"."SAP_BOX_NOTE_DTL"."PURCHASE_NO_ITEM" IS '采购凭证的项目编号';
COMMENT ON COLUMN "SPMS"."SAP_BOX_NOTE_DTL"."DELIVERY_NOTE_SAP" IS '交货单号';
COMMENT ON COLUMN "SPMS"."SAP_BOX_NOTE_DTL"."DELIVERY_NOTE_SAP_ITEM" IS '交货单行项目编号';
COMMENT ON COLUMN "SPMS"."SAP_BOX_NOTE_DTL"."DEMAND_NO" IS '需求来源号';
COMMENT ON COLUMN "SPMS"."SAP_BOX_NOTE_DTL"."DEMAND_NO_ITEM" IS '需求来源号行号';
COMMENT ON COLUMN "SPMS"."SAP_BOX_NOTE_DTL"."DEMANDER" IS '需求申请人';
COMMENT ON COLUMN "SPMS"."SAP_BOX_NOTE_DTL"."REMARK" IS '备注';
COMMENT ON COLUMN "SPMS"."SAP_BOX_NOTE_DTL"."GROSS_WEIGHT" IS '毛重';
COMMENT ON COLUMN "SPMS"."SAP_BOX_NOTE_DTL"."NET_WEIGHT" IS '净重';
COMMENT ON COLUMN "SPMS"."SAP_BOX_NOTE_DTL"."DOMESTIC_QTY_RECEIVABLE" IS '国内收货数量-国内收获时箱的数量';
COMMENT ON COLUMN "SPMS"."SAP_BOX_NOTE_DTL"."DOMESTIC_QTY_RECEIVED" IS '国内实际数量-国内收货时默认箱内对应物料数量，可能拆分';
COMMENT ON COLUMN "SPMS"."SAP_BOX_NOTE_DTL"."OVERSEA_QTY_RECEIVED" IS '海外收货数量';
COMMENT ON COLUMN "SPMS"."SAP_BOX_NOTE_DTL"."CREATE_TIME" IS 'SPMS创建时间';
COMMENT ON TABLE "SPMS"."SAP_BOX_NOTE_DTL" IS '箱码行项目表';

-- ----------------------------
-- Table structure for SAP_DELIVERY_NOTE
-- ----------------------------
DROP TABLE "SPMS"."SAP_DELIVERY_NOTE";
CREATE TABLE "SPMS"."SAP_DELIVERY_NOTE" (
  "DELIVERY_NOTE_SAP" VARCHAR2(10 BYTE) VISIBLE NOT NULL,
  "PLANNED_ARRIVAL_DATE" VARCHAR2(10 BYTE) VISIBLE,
  "DELIVERY_TYPE" VARCHAR2(4 BYTE) VISIBLE,
  "DELIVERY_NOTE_SRM" VARCHAR2(50 BYTE) VISIBLE,
  "CREATE_DATE_SAP" VARCHAR2(10 BYTE) VISIBLE,
  "SPMS_MARK" VARCHAR2(2 BYTE) VISIBLE,
  "SUPPLIER_CODE" VARCHAR2(50 BYTE) VISIBLE,
  "SUPPLIER_DESC" VARCHAR2(255 BYTE) VISIBLE,
  "SPMS_STATUS" VARCHAR2(2 BYTE) VISIBLE,
  "PACKAGE_NOTE" VARCHAR2(50 BYTE) VISIBLE,
  "REMARKS" VARCHAR2(255 BYTE) VISIBLE,
  "DOCUMENT_DATE" VARCHAR2(10 BYTE) VISIBLE,
  "POSTING_DATE" VARCHAR2(10 BYTE) VISIBLE,
  "MOBILE_TYPE" VARCHAR2(3 BYTE) VISIBLE,
  "USER_ID" VARCHAR2(10 BYTE) VISIBLE,
  "PDA_SN" VARCHAR2(32 BYTE) VISIBLE,
  "SAP_VOUCHER_NUMBER" VARCHAR2(16 BYTE) VISIBLE,
  "SAP_VOUCHER_YEAR" VARCHAR2(4 BYTE) VISIBLE,
  "CREATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss'),
  "UPDATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss'),
  "OPERATE_USER" VARCHAR2(255 BYTE) VISIBLE,
  "CANCEL_POSTING_DATE" VARCHAR2(12 BYTE) VISIBLE,
  "CANCEL_SAP_VOUCHER_NUMBER" VARCHAR2(32 BYTE) VISIBLE,
  "CANCEL_REMARK" VARCHAR2(255 BYTE) VISIBLE
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE"."DELIVERY_NOTE_SAP" IS 'SAP交货单号';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE"."PLANNED_ARRIVAL_DATE" IS '计划到货时间';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE"."DELIVERY_TYPE" IS '交货类型';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE"."DELIVERY_NOTE_SRM" IS 'SRM送货单号';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE"."CREATE_DATE_SAP" IS 'SAP创建日期';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE"."SPMS_MARK" IS 'SPMS标识（SAP提供-X表示备件货，空表示贸易货）';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE"."SUPPLIER_CODE" IS '供应商编号';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE"."SUPPLIER_DESC" IS '供应商描述';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE"."SPMS_STATUS" IS 'SPMS 状态，任务开始执行则会被锁定，忽略更新';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE"."PACKAGE_NOTE" IS '包装单号-有值为备件货；无值为贸易货；';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE"."REMARKS" IS '交货单表头备注信息';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE"."DOCUMENT_DATE" IS '凭证日期-开始处理日期';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE"."POSTING_DATE" IS '过账日期-提交SAP日期';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE"."MOBILE_TYPE" IS '移动类型';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE"."USER_ID" IS '操作员工号/确认到货操作人员';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE"."PDA_SN" IS 'PDA设备编号(验收时传入)';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE"."SAP_VOUCHER_NUMBER" IS 'SAP物料凭证-提交SAP成功后回写';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE"."SAP_VOUCHER_YEAR" IS '会计年份/SAP凭证年份';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE"."CREATE_TIME" IS 'SPMS创建时间';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE"."UPDATE_TIME" IS 'SPMS更新时间';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE"."OPERATE_USER" IS '操作员/现场搬运工计费';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE"."CANCEL_POSTING_DATE" IS '撤销SAP过账日期';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE"."CANCEL_SAP_VOUCHER_NUMBER" IS '撤销SAP物料凭证-撤销提交SAP成功后回写';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE"."CANCEL_REMARK" IS '撤销备注信息';
COMMENT ON TABLE "SPMS"."SAP_DELIVERY_NOTE" IS 'SAP交货单表头';

-- ----------------------------
-- Table structure for SAP_DELIVERY_NOTE_DTL
-- ----------------------------
DROP TABLE "SPMS"."SAP_DELIVERY_NOTE_DTL";
CREATE TABLE "SPMS"."SAP_DELIVERY_NOTE_DTL" (
  "DELIVERY_NOTE_SAP" VARCHAR2(10 BYTE) VISIBLE,
  "DELIVERY_NOTE_SAP_ITEM" NUMBER VISIBLE,
  "PURCHASE_GROUP" VARCHAR2(6 BYTE) VISIBLE,
  "PURCHASE_GROUP_NAME" VARCHAR2(64 BYTE) VISIBLE,
  "MATERIAL_NO" VARCHAR2(32 BYTE) VISIBLE,
  "DELIVERY_QTY" NUMBER(13,3) VISIBLE,
  "DELIVERY_UNIT" VARCHAR2(3 BYTE) VISIBLE,
  "WERKS" VARCHAR2(6 BYTE) VISIBLE,
  "WHS_LOCATION_CODE" VARCHAR2(4 BYTE) VISIBLE,
  "RECEIVED_QTY" NUMBER(13,3) VISIBLE,
  "ITEM_STATUS" VARCHAR2(2 BYTE) VISIBLE DEFAULT 0,
  "OVER_DELIVERY_LIMIT" NUMBER VISIBLE,
  "UNDER_DELIVERY_LIMIT" NUMBER VISIBLE,
  "UNLIMITED" VARCHAR2(2 BYTE) VISIBLE,
  "REMARKS" VARCHAR2(255 BYTE) VISIBLE,
  "TEMP_STORAGE" VARCHAR2(4000 BYTE) VISIBLE,
  "WERKS_XQ" VARCHAR2(6 BYTE) VISIBLE,
  "QTY_SALES" NUMBER(13,3) VISIBLE,
  "UNIT_SALES" VARCHAR2(3 BYTE) VISIBLE,
  "ACTUAL_QTY_SALES" NUMBER(13,3) VISIBLE,
  "CREATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss'),
  "UPDATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss'),
  "SPMS_ITEM" NUMBER VISIBLE,
  "DOCUMENT_DATE" VARCHAR2(10 BYTE) VISIBLE,
  "SAP_VOUCHER_NUMBER" VARCHAR2(16 BYTE) VISIBLE,
  "SAP_VOUCHER_YEAR" VARCHAR2(4 BYTE) VISIBLE,
  "POSTING_DATE" VARCHAR2(10 BYTE) VISIBLE,
  "CANCEL_VOUCHER_NUMBER" VARCHAR2(16 BYTE) VISIBLE,
  "CANCEL_VOUCHER_YEAR" VARCHAR2(4 BYTE) VISIBLE,
  "CANCEL_REMARK" VARCHAR2(255 BYTE) VISIBLE,
  "USER_ID" VARCHAR2(16 BYTE) VISIBLE,
  "OPERATOR" VARCHAR2(64 BYTE) VISIBLE
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE_DTL"."DELIVERY_NOTE_SAP" IS 'SAP交货单号';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE_DTL"."DELIVERY_NOTE_SAP_ITEM" IS 'SAP交货单行号';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE_DTL"."PURCHASE_GROUP" IS '采购组';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE_DTL"."PURCHASE_GROUP_NAME" IS '采购组名称';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE_DTL"."MATERIAL_NO" IS '物料编号';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE_DTL"."DELIVERY_QTY" IS '交货数量';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE_DTL"."DELIVERY_UNIT" IS '交货单位-基本单位';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE_DTL"."WERKS" IS '工厂';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE_DTL"."WHS_LOCATION_CODE" IS '库存地点';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE_DTL"."RECEIVED_QTY" IS '实际收货数量（基本单位）';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE_DTL"."ITEM_STATUS" IS '交货单贸易货行项目状态（默认0-待到货；3-收货中；7-提交SAP失败；8-提交SAP完成；11-删除/关闭；12-已撤销；）';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE_DTL"."OVER_DELIVERY_LIMIT" IS '过量交货限度';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE_DTL"."UNDER_DELIVERY_LIMIT" IS '交货不足限度';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE_DTL"."UNLIMITED" IS '无限制';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE_DTL"."REMARKS" IS '交货单行项目备注';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE_DTL"."TEMP_STORAGE" IS '物料临时储位信息表，包含：物料-储位-数量关系';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE_DTL"."WERKS_XQ" IS '需求工厂';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE_DTL"."QTY_SALES" IS '销售单位应收数量';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE_DTL"."UNIT_SALES" IS '销售单位';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE_DTL"."ACTUAL_QTY_SALES" IS '销售单位实收数量';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE_DTL"."CREATE_TIME" IS 'SPMS创建时间';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE_DTL"."UPDATE_TIME" IS 'SPMS更新时间';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE_DTL"."SPMS_ITEM" IS '交货单明细SPMS行号';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE_DTL"."DOCUMENT_DATE" IS '凭证日期-开始处理日期';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE_DTL"."SAP_VOUCHER_NUMBER" IS 'SAP凭证号';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE_DTL"."SAP_VOUCHER_YEAR" IS 'SAP凭证年份';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE_DTL"."POSTING_DATE" IS '过账日期';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE_DTL"."CANCEL_VOUCHER_NUMBER" IS '撤销凭证号';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE_DTL"."CANCEL_VOUCHER_YEAR" IS '撤销凭证年份';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE_DTL"."CANCEL_REMARK" IS '撤销备注';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE_DTL"."USER_ID" IS '用户工号';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE_DTL"."OPERATOR" IS '操作员';
COMMENT ON TABLE "SPMS"."SAP_DELIVERY_NOTE_DTL" IS 'SAP交货单表明细';

-- ----------------------------
-- Table structure for SAP_DELIVERY_NOTE_LOG
-- ----------------------------
DROP TABLE "SPMS"."SAP_DELIVERY_NOTE_LOG";
CREATE TABLE "SPMS"."SAP_DELIVERY_NOTE_LOG" (
  "UUID" VARCHAR2(32 BYTE) VISIBLE NOT NULL,
  "DOCUMENT_NUMBER" VARCHAR2(255 BYTE) VISIBLE,
  "USER_ID" VARCHAR2(20 BYTE) VISIBLE,
  "OPERATION_TYPE" VARCHAR2(255 BYTE) VISIBLE,
  "COMMENTS" VARCHAR2(255 BYTE) VISIBLE,
  "RELATE_DOCUMENT_NUMBER" VARCHAR2(32 BYTE) VISIBLE,
  "CREATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss'),
  "LOG_AUTO_ID" NUMBER VISIBLE,
  "REMARK" CLOB VISIBLE,
  "REQUEST_PARAM" CLOB VISIBLE
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE_LOG"."UUID" IS '主键UUID-java生成';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE_LOG"."DOCUMENT_NUMBER" IS '单据号/交货单日志记录交货单号；上架下架任务日志记录上架下架任务uuid；出库任务记录出库任务uuid；';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE_LOG"."USER_ID" IS '用户工号';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE_LOG"."OPERATION_TYPE" IS '操作类型';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE_LOG"."COMMENTS" IS '操作内容/评论';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE_LOG"."RELATE_DOCUMENT_NUMBER" IS '关联单据号(记录上架任务关联的交货单号)';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE_LOG"."CREATE_TIME" IS '创建时间';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE_LOG"."LOG_AUTO_ID" IS '单据日志信息表自增ID';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE_LOG"."REMARK" IS '备注信息/SAP返回数据';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE_LOG"."REQUEST_PARAM" IS '请求参数';
COMMENT ON TABLE "SPMS"."SAP_DELIVERY_NOTE_LOG" IS '单据日志信息表';

-- ----------------------------
-- Table structure for SAP_DELIVERY_NOTE_SPMS
-- ----------------------------
DROP TABLE "SPMS"."SAP_DELIVERY_NOTE_SPMS";
CREATE TABLE "SPMS"."SAP_DELIVERY_NOTE_SPMS" (
  "SPMS_UUID" VARCHAR2(32 BYTE) VISIBLE NOT NULL,
  "SPMS_ID" VARCHAR2(32 BYTE) VISIBLE,
  "TASK_STATUS" VARCHAR2(2 BYTE) VISIBLE,
  "DELIVERY_NOTE_SAP" VARCHAR2(10 BYTE) VISIBLE NOT NULL,
  "PLANNED_ARRIVAL_DATE" VARCHAR2(10 BYTE) VISIBLE,
  "DELIVERY_TYPE" VARCHAR2(4 BYTE) VISIBLE,
  "DELIVERY_NOTE_SRM" VARCHAR2(35 BYTE) VISIBLE,
  "CREATE_DATE_SAP" VARCHAR2(10 BYTE) VISIBLE,
  "SPMS_MARK" VARCHAR2(2 BYTE) VISIBLE,
  "SUPPLIER_CODE" VARCHAR2(10 BYTE) VISIBLE,
  "SUPPLIER_DESC" VARCHAR2(200 BYTE) VISIBLE,
  "SPMS_STATUS" VARCHAR2(2 BYTE) VISIBLE,
  "WERKS" VARCHAR2(6 BYTE) VISIBLE,
  "WHS_LOCATION_CODE" VARCHAR2(4 BYTE) VISIBLE,
  "DOCUMENT_DATE" VARCHAR2(10 BYTE) VISIBLE,
  "POSTING_DATE" VARCHAR2(10 BYTE) VISIBLE,
  "OPERATE_USERNAME" VARCHAR2(40 BYTE) VISIBLE,
  "MOBILE_TYPE" VARCHAR2(6 BYTE) VISIBLE,
  "REMARKS" VARCHAR2(128 BYTE) VISIBLE,
  "CREATE_USER" VARCHAR2(40 BYTE) VISIBLE,
  "CREATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss')
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE_SPMS"."SPMS_UUID" IS 'SPMS UUID';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE_SPMS"."SPMS_ID" IS 'SPMS任务凭证号';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE_SPMS"."TASK_STATUS" IS 'SPMS任务状态';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE_SPMS"."DELIVERY_NOTE_SAP" IS 'SAP交货单号';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE_SPMS"."PLANNED_ARRIVAL_DATE" IS '计划到货时间';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE_SPMS"."DELIVERY_TYPE" IS '交货类型';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE_SPMS"."DELIVERY_NOTE_SRM" IS 'SRM送货单号';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE_SPMS"."CREATE_DATE_SAP" IS 'SAP创建日期';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE_SPMS"."SPMS_MARK" IS 'SPMS标识（SAP提供-X表示备件货，空表示贸易货）';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE_SPMS"."SUPPLIER_CODE" IS '供应商编号';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE_SPMS"."SUPPLIER_DESC" IS '供应商描述';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE_SPMS"."SPMS_STATUS" IS 'SPMS 状态，任务开始执行则会被锁定，忽略更新';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE_SPMS"."WERKS" IS '工厂';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE_SPMS"."WHS_LOCATION_CODE" IS '收货仓库';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE_SPMS"."DOCUMENT_DATE" IS '凭证日期';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE_SPMS"."POSTING_DATE" IS '过账日期';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE_SPMS"."OPERATE_USERNAME" IS '操作人姓名';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE_SPMS"."MOBILE_TYPE" IS '移动类型';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE_SPMS"."REMARKS" IS '备注';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE_SPMS"."CREATE_USER" IS '创建人';
COMMENT ON COLUMN "SPMS"."SAP_DELIVERY_NOTE_SPMS"."CREATE_TIME" IS '创建时间';
COMMENT ON TABLE "SPMS"."SAP_DELIVERY_NOTE_SPMS" IS 'SPMS交货单表头';

-- ----------------------------
-- Table structure for SAP_PACKAGE_BOX
-- ----------------------------
DROP TABLE "SPMS"."SAP_PACKAGE_BOX";
CREATE TABLE "SPMS"."SAP_PACKAGE_BOX" (
  "PACKAGE_LIST" VARCHAR2(10 BYTE) VISIBLE,
  "ITEM" VARCHAR2(6 BYTE) VISIBLE,
  "BOX_NOTE" VARCHAR2(50 BYTE) VISIBLE,
  "ACTUAL_OPERATE_QTY" NUMBER VISIBLE,
  "UNPLANNED" VARCHAR2(2 BYTE) VISIBLE,
  "WHS_OUT_UUID" VARCHAR2(32 BYTE) VISIBLE,
  "CONTAINER_BRAND" VARCHAR2(64 BYTE) VISIBLE,
  "PACKING_SPEC" VARCHAR2(128 BYTE) VISIBLE,
  "LOADING_TYPE" VARCHAR2(128 BYTE) VISIBLE,
  "CREATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss')
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_BOX"."PACKAGE_LIST" IS '装箱单号';
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_BOX"."ITEM" IS '装箱单行号';
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_BOX"."BOX_NOTE" IS '箱码';
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_BOX"."ACTUAL_OPERATE_QTY" IS '实际操作出库数量';
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_BOX"."UNPLANNED" IS '是否计划外的箱码，默认空，1表示计划外的箱码';
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_BOX"."WHS_OUT_UUID" IS '新增计划外的箱码时，存入出库任务uuid关联';
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_BOX"."CONTAINER_BRAND" IS '外箱品牌';
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_BOX"."PACKING_SPEC" IS '包装规格';
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_BOX"."LOADING_TYPE" IS '装柜方式';
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_BOX"."CREATE_TIME" IS 'SPMS创建时间';
COMMENT ON TABLE "SPMS"."SAP_PACKAGE_BOX" IS '装箱单箱码关系表';

-- ----------------------------
-- Table structure for SAP_PACKAGE_LIST
-- ----------------------------
DROP TABLE "SPMS"."SAP_PACKAGE_LIST";
CREATE TABLE "SPMS"."SAP_PACKAGE_LIST" (
  "PACKAGE_LIST" VARCHAR2(10 BYTE) VISIBLE NOT NULL,
  "CUSTOMER" VARCHAR2(50 BYTE) VISIBLE,
  "SPARE_PARTS" VARCHAR2(10 BYTE) VISIBLE,
  "PLANNED_CABINETS_QTY" NUMBER VISIBLE,
  "FROM_PORT" VARCHAR2(50 BYTE) VISIBLE,
  "FROM_PORT_NAME" VARCHAR2(255 BYTE) VISIBLE,
  "TO_PORT" VARCHAR2(255 BYTE) VISIBLE,
  "TO_PORT_NAME" VARCHAR2(255 BYTE) VISIBLE,
  "SHIP_COMPANY" VARCHAR2(128 BYTE) VISIBLE,
  "CABINET_MODEL" VARCHAR2(4 BYTE) VISIBLE,
  "PLANNER" VARCHAR2(128 BYTE) VISIBLE,
  "LOADER" VARCHAR2(128 BYTE) VISIBLE,
  "ACTUAL_LOADING_DATE" VARCHAR2(10 BYTE) VISIBLE,
  "SPMS_STATUS" VARCHAR2(2 BYTE) VISIBLE DEFAULT 0,
  "CREATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss'),
  "UPDATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss')
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_LIST"."PACKAGE_LIST" IS '装箱单号';
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_LIST"."CUSTOMER" IS '客户';
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_LIST"."SPARE_PARTS" IS '是否杂货';
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_LIST"."PLANNED_CABINETS_QTY" IS '计划柜量';
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_LIST"."FROM_PORT" IS '起运港';
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_LIST"."FROM_PORT_NAME" IS '起运港名称';
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_LIST"."TO_PORT" IS '目的港';
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_LIST"."TO_PORT_NAME" IS '目的港名称';
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_LIST"."SHIP_COMPANY" IS '船公司';
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_LIST"."CABINET_MODEL" IS '柜型';
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_LIST"."PLANNER" IS '计划员';
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_LIST"."LOADER" IS '装柜员';
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_LIST"."ACTUAL_LOADING_DATE" IS '实际装柜日期';
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_LIST"."SPMS_STATUS" IS '任务在SPMS状态(0待处理；1处理中；2处理完成)';
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_LIST"."CREATE_TIME" IS 'SPMS创建时间';
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_LIST"."UPDATE_TIME" IS 'SPMS更新时间';
COMMENT ON TABLE "SPMS"."SAP_PACKAGE_LIST" IS 'SAP装箱单表抬头';

-- ----------------------------
-- Table structure for SAP_PACKAGE_LIST_DTL
-- ----------------------------
DROP TABLE "SPMS"."SAP_PACKAGE_LIST_DTL";
CREATE TABLE "SPMS"."SAP_PACKAGE_LIST_DTL" (
  "PACKAGE_LIST" VARCHAR2(10 BYTE) VISIBLE,
  "ITEM" VARCHAR2(6 BYTE) VISIBLE,
  "DATE_OF_LOADING" VARCHAR2(10 BYTE) VISIBLE,
  "LOADING_WERKS" VARCHAR2(6 BYTE) VISIBLE,
  "LOADING_WHS_LOCATION_CODE" VARCHAR2(4 BYTE) VISIBLE,
  "CABINET_SERIAL_NUMBER" VARCHAR2(2 BYTE) VISIBLE,
  "GOODS_TYPE" VARCHAR2(30 BYTE) VISIBLE,
  "RECEIVING_WERKS" VARCHAR2(6 BYTE) VISIBLE,
  "ACTUAL_RECEIVING_WERKS" VARCHAR2(6 BYTE) VISIBLE,
  "CABINET_NUMBER" VARCHAR2(16 BYTE) VISIBLE,
  "LEAD_SEAL" VARCHAR2(16 BYTE) VISIBLE,
  "MATERIAL_NO" VARCHAR2(18 BYTE) VISIBLE,
  "SHIPMENT_CATEGORY" VARCHAR2(128 BYTE) VISIBLE,
  "PLANNED_PACKING_QTY" NUMBER(17,3) VISIBLE,
  "BASIC_UNIT" VARCHAR2(3 BYTE) VISIBLE,
  "PLANNED_PACKING_NUMBER" NUMBER(17,3) VISIBLE,
  "PACKING_UNIT" VARCHAR2(3 BYTE) VISIBLE,
  "CABINET_WEIGHT" NUMBER(17,6) VISIBLE,
  "WEIGHT_UNIT" VARCHAR2(6 BYTE) VISIBLE,
  "CABINET_VOLUME" NUMBER(17,6) VISIBLE,
  "VOLUME_UNIT" VARCHAR2(6 BYTE) VISIBLE,
  "TRAILER_LINE" VARCHAR2(64 BYTE) VISIBLE,
  "TRAILER_LINE_DESC" VARCHAR2(128 BYTE) VISIBLE,
  "SPMS_STATUS" VARCHAR2(2 BYTE) VISIBLE DEFAULT 0,
  "WHS_OUT_UUID" VARCHAR2(32 BYTE) VISIBLE,
  "TEMP_STORAGE" VARCHAR2(4000 BYTE) VISIBLE,
  "UNPLANNED" VARCHAR2(2 BYTE) VISIBLE,
  "ACTUAL_OPERATE_QTY" NUMBER(17,3) VISIBLE,
  "CONTAINER_BRAND" VARCHAR2(64 BYTE) VISIBLE,
  "COLOR_NUMBER" VARCHAR2(32 BYTE) VISIBLE,
  "THICKNESS" NUMBER(7,3) VISIBLE,
  "ACTUAL_AVG_GROSS_WEIGHT" NUMBER(7,3) VISIBLE,
  "ACTUAL_PACKING_NUMBER" NUMBER(17,3) VISIBLE,
  "CUSTOMS_DECLARATION_NUMBER" NUMBER(17,3) VISIBLE,
  "PACKING_SPEC" VARCHAR2(128 BYTE) VISIBLE,
  "LOADING_TYPE" VARCHAR2(128 BYTE) VISIBLE,
  "CREATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss'),
  "UPDATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss')
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_LIST_DTL"."PACKAGE_LIST" IS '装箱单号';
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_LIST_DTL"."ITEM" IS '装箱单行号';
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_LIST_DTL"."DATE_OF_LOADING" IS '可装柜日期';
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_LIST_DTL"."LOADING_WERKS" IS '装柜工厂代码';
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_LIST_DTL"."LOADING_WHS_LOCATION_CODE" IS '装柜仓库代码';
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_LIST_DTL"."CABINET_SERIAL_NUMBER" IS '柜序号';
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_LIST_DTL"."GOODS_TYPE" IS '货物类型/产品层次';
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_LIST_DTL"."RECEIVING_WERKS" IS '收货工厂';
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_LIST_DTL"."ACTUAL_RECEIVING_WERKS" IS '实际收货工厂';
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_LIST_DTL"."CABINET_NUMBER" IS '柜号';
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_LIST_DTL"."LEAD_SEAL" IS '铅封号';
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_LIST_DTL"."MATERIAL_NO" IS '物料编号';
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_LIST_DTL"."SHIPMENT_CATEGORY" IS '出货品类';
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_LIST_DTL"."PLANNED_PACKING_QTY" IS '计划装箱数量(基本单位)';
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_LIST_DTL"."BASIC_UNIT" IS '基本单位';
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_LIST_DTL"."PLANNED_PACKING_NUMBER" IS '计划装箱件数';
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_LIST_DTL"."PACKING_UNIT" IS '包装单位';
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_LIST_DTL"."CABINET_WEIGHT" IS '柜重量';
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_LIST_DTL"."WEIGHT_UNIT" IS '重量单位';
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_LIST_DTL"."CABINET_VOLUME" IS '柜体积';
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_LIST_DTL"."VOLUME_UNIT" IS '体积单位';
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_LIST_DTL"."TRAILER_LINE" IS '出发国拖车线路';
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_LIST_DTL"."TRAILER_LINE_DESC" IS '出发国拖车线路名称';
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_LIST_DTL"."SPMS_STATUS" IS '装箱单行项目在SPMS状态，默认0(0待执行，1执行中，2出库完成，3任务关闭，4提交SAP成功)';
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_LIST_DTL"."WHS_OUT_UUID" IS '出库任务UUID-贸易货';
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_LIST_DTL"."TEMP_STORAGE" IS '储位信息。用于存储贸易货储位uuid 数量等信息';
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_LIST_DTL"."UNPLANNED" IS '是否为计划外的明细。默认空，额外出库的贸易货需传值1';
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_LIST_DTL"."ACTUAL_OPERATE_QTY" IS '贸易货实际装箱数量(基本单位)';
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_LIST_DTL"."CONTAINER_BRAND" IS '外箱品牌';
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_LIST_DTL"."COLOR_NUMBER" IS '色号（砖类）';
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_LIST_DTL"."THICKNESS" IS '砖厚';
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_LIST_DTL"."ACTUAL_AVG_GROSS_WEIGHT" IS '产品实际平均毛重';
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_LIST_DTL"."ACTUAL_PACKING_NUMBER" IS '实际装箱件数（销售单位）';
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_LIST_DTL"."CUSTOMS_DECLARATION_NUMBER" IS '报关件数';
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_LIST_DTL"."PACKING_SPEC" IS '包装规格';
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_LIST_DTL"."LOADING_TYPE" IS '装柜方式';
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_LIST_DTL"."CREATE_TIME" IS 'SPMS创建时间';
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_LIST_DTL"."UPDATE_TIME" IS 'SPMS更新时间';
COMMENT ON TABLE "SPMS"."SAP_PACKAGE_LIST_DTL" IS 'SAP装箱单明细表';

-- ----------------------------
-- Table structure for SAP_PACKAGE_NOTE
-- ----------------------------
DROP TABLE "SPMS"."SAP_PACKAGE_NOTE";
CREATE TABLE "SPMS"."SAP_PACKAGE_NOTE" (
  "PACKAGE_NOTE" VARCHAR2(50 BYTE) VISIBLE NOT NULL,
  "DELIVERY_NOTE_SRM" VARCHAR2(50 BYTE) VISIBLE,
  "DELIVERY_NOTE_SAP" VARCHAR2(50 BYTE) VISIBLE,
  "SUPPLIER_CODE" VARCHAR2(32 BYTE) VISIBLE,
  "TOTAL_VOLUME" NUMBER(13,3) VISIBLE,
  "TOTAL_WEIGHT" NUMBER(13,3) VISIBLE,
  "LOAD_BEGIN_TIME" VARCHAR2(10 BYTE) VISIBLE,
  "LOAD_END_TIME" VARCHAR2(10 BYTE) VISIBLE,
  "TRANSPORTER" VARCHAR2(255 BYTE) VISIBLE,
  "CONTRACTOR_INFO" VARCHAR2(32 BYTE) VISIBLE,
  "RECEIVER" VARCHAR2(128 BYTE) VISIBLE,
  "RECEIVER_INFO" VARCHAR2(50 BYTE) VISIBLE,
  "RECEIVING_ADDRESS" VARCHAR2(255 BYTE) VISIBLE,
  "SPMS_CONTRACT_NOTE" VARCHAR2(64 BYTE) VISIBLE,
  "SPMS_MARK" VARCHAR2(2 BYTE) VISIBLE,
  "CREATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss')
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_NOTE"."PACKAGE_NOTE" IS '包装单号';
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_NOTE"."DELIVERY_NOTE_SRM" IS 'SRM送货单号';
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_NOTE"."DELIVERY_NOTE_SAP" IS 'SAP交货单号';
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_NOTE"."SUPPLIER_CODE" IS '供应商或债权人的帐号';
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_NOTE"."TOTAL_VOLUME" IS '总体积(CM3)';
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_NOTE"."TOTAL_WEIGHT" IS '总重量(KG)';
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_NOTE"."LOAD_BEGIN_TIME" IS '装卸开始时间';
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_NOTE"."LOAD_END_TIME" IS '装卸结束时间';
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_NOTE"."TRANSPORTER" IS '运输人';
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_NOTE"."CONTRACTOR_INFO" IS '承运人联系方式';
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_NOTE"."RECEIVER" IS '收货人';
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_NOTE"."RECEIVER_INFO" IS '收货人联系方式';
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_NOTE"."RECEIVING_ADDRESS" IS '收货地址';
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_NOTE"."SPMS_CONTRACT_NOTE" IS 'SPMS线下合同号';
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_NOTE"."SPMS_MARK" IS 'SPMS标识';
COMMENT ON COLUMN "SPMS"."SAP_PACKAGE_NOTE"."CREATE_TIME" IS 'SPMS创建时间';
COMMENT ON TABLE "SPMS"."SAP_PACKAGE_NOTE" IS '包装单号表';

-- ----------------------------
-- Table structure for SHELF_ON_TASK
-- ----------------------------
DROP TABLE "SPMS"."SHELF_ON_TASK";
CREATE TABLE "SPMS"."SHELF_ON_TASK" (
  "UUID" VARCHAR2(32 BYTE) VISIBLE NOT NULL,
  "TASK_ID" VARCHAR2(32 BYTE) VISIBLE,
  "WERKS" VARCHAR2(6 BYTE) VISIBLE,
  "WHS_LOCATION_CODE" VARCHAR2(6 BYTE) VISIBLE,
  "CREATE_USERID" VARCHAR2(64 BYTE) VISIBLE,
  "CREATE_DATE" VARCHAR2(16 BYTE) VISIBLE,
  "TASK_STATUS" VARCHAR2(2 BYTE) VISIBLE,
  "CREATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss'),
  "UPDATE_USERNAME" VARCHAR2(64 BYTE) VISIBLE,
  "UPDATE_TIME" DATE VISIBLE,
  "DELIVERY_NOTE_SAP" VARCHAR2(10 BYTE) VISIBLE,
  "PDA_SN" VARCHAR2(32 BYTE) VISIBLE,
  "TASK_TYPE" VARCHAR2(2 BYTE) VISIBLE,
  "RELATE_DOC_NUMBER" VARCHAR2(32 BYTE) VISIBLE
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."SHELF_ON_TASK"."UUID" IS '上架下架任务UUID';
COMMENT ON COLUMN "SPMS"."SHELF_ON_TASK"."TASK_ID" IS '上架下架任务单号';
COMMENT ON COLUMN "SPMS"."SHELF_ON_TASK"."WERKS" IS '工厂编号';
COMMENT ON COLUMN "SPMS"."SHELF_ON_TASK"."WHS_LOCATION_CODE" IS '仓库地点代码';
COMMENT ON COLUMN "SPMS"."SHELF_ON_TASK"."CREATE_USERID" IS '创建人工号';
COMMENT ON COLUMN "SPMS"."SHELF_ON_TASK"."CREATE_DATE" IS '创建日期';
COMMENT ON COLUMN "SPMS"."SHELF_ON_TASK"."TASK_STATUS" IS '任务状态：1待上架；2上架中；3已完成；4待下架；5下架中；6出库待下架；7出库下架中；只有完成状态才更新储位库存。';
COMMENT ON COLUMN "SPMS"."SHELF_ON_TASK"."CREATE_TIME" IS '创建时间';
COMMENT ON COLUMN "SPMS"."SHELF_ON_TASK"."UPDATE_USERNAME" IS '更新人姓名';
COMMENT ON COLUMN "SPMS"."SHELF_ON_TASK"."UPDATE_TIME" IS '更新时间';
COMMENT ON COLUMN "SPMS"."SHELF_ON_TASK"."DELIVERY_NOTE_SAP" IS '交货单号';
COMMENT ON COLUMN "SPMS"."SHELF_ON_TASK"."PDA_SN" IS 'PDA设备编号';
COMMENT ON COLUMN "SPMS"."SHELF_ON_TASK"."TASK_TYPE" IS '1上架任务；2下架任务；';
COMMENT ON COLUMN "SPMS"."SHELF_ON_TASK"."RELATE_DOC_NUMBER" IS '关联单据号/出库任务uuid';
COMMENT ON TABLE "SPMS"."SHELF_ON_TASK" IS '上架下架任务表';

-- ----------------------------
-- Table structure for SHELF_ON_TASK_DTL
-- ----------------------------
DROP TABLE "SPMS"."SHELF_ON_TASK_DTL";
CREATE TABLE "SPMS"."SHELF_ON_TASK_DTL" (
  "UUID" VARCHAR2(32 BYTE) VISIBLE,
  "TASK_ROW_ID" VARCHAR2(6 BYTE) VISIBLE,
  "MATERIAL_NO" VARCHAR2(32 BYTE) VISIBLE,
  "BOX_NOTE" VARCHAR2(50 BYTE) VISIBLE,
  "QUANTITY" NUMBER VISIBLE,
  "CURRENT_STORAGE" VARCHAR2(32 BYTE) VISIBLE,
  "TARGET_STORAGE" VARCHAR2(32 BYTE) VISIBLE,
  "DELIVERY_NOTE_SAP" VARCHAR2(10 BYTE) VISIBLE,
  "ACTUAL_OPERATE_QTY" NUMBER VISIBLE,
  "UNPLANNED" VARCHAR2(2 BYTE) VISIBLE
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."SHELF_ON_TASK_DTL"."UUID" IS '上架下架任务UUID';
COMMENT ON COLUMN "SPMS"."SHELF_ON_TASK_DTL"."TASK_ROW_ID" IS '上架下架任务行号';
COMMENT ON COLUMN "SPMS"."SHELF_ON_TASK_DTL"."MATERIAL_NO" IS '物料编号';
COMMENT ON COLUMN "SPMS"."SHELF_ON_TASK_DTL"."BOX_NOTE" IS '箱码-仅用于自管仓备件管理';
COMMENT ON COLUMN "SPMS"."SHELF_ON_TASK_DTL"."QUANTITY" IS '数量';
COMMENT ON COLUMN "SPMS"."SHELF_ON_TASK_DTL"."CURRENT_STORAGE" IS '当前储位UUID';
COMMENT ON COLUMN "SPMS"."SHELF_ON_TASK_DTL"."TARGET_STORAGE" IS '目标储位UUID';
COMMENT ON COLUMN "SPMS"."SHELF_ON_TASK_DTL"."DELIVERY_NOTE_SAP" IS 'SAP交货单号';
COMMENT ON COLUMN "SPMS"."SHELF_ON_TASK_DTL"."ACTUAL_OPERATE_QTY" IS '实际操作数量/实际下架数量';
COMMENT ON COLUMN "SPMS"."SHELF_ON_TASK_DTL"."UNPLANNED" IS '是否原单据行项目，默认空。出库任务用户可新增行，新增行赋值1.';
COMMENT ON TABLE "SPMS"."SHELF_ON_TASK_DTL" IS '上架下架任务表明细';

-- ----------------------------
-- Table structure for SHOPPING_CART
-- ----------------------------
DROP TABLE "SPMS"."SHOPPING_CART";
CREATE TABLE "SPMS"."SHOPPING_CART" (
  "WORK_CODE" VARCHAR2(32 BYTE) VISIBLE NOT NULL,
  "MATERIAL_NO" VARCHAR2(64 BYTE) VISIBLE NOT NULL,
  "QUANTITY" NUMBER VISIBLE,
  "CREATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss'),
  "UPDATE_TIME" DATE VISIBLE DEFAULT NULL,
  "LONG_CONTRACT_CODE" VARCHAR2(128 BYTE) VISIBLE,
  "BRAND" VARCHAR2(40 BYTE) VISIBLE
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."SHOPPING_CART"."WORK_CODE" IS '创建者编号-用户工号';
COMMENT ON COLUMN "SPMS"."SHOPPING_CART"."MATERIAL_NO" IS '物料编号';
COMMENT ON COLUMN "SPMS"."SHOPPING_CART"."QUANTITY" IS '数量';
COMMENT ON COLUMN "SPMS"."SHOPPING_CART"."CREATE_TIME" IS '创建时间';
COMMENT ON COLUMN "SPMS"."SHOPPING_CART"."UPDATE_TIME" IS '更新时间';
COMMENT ON COLUMN "SPMS"."SHOPPING_CART"."LONG_CONTRACT_CODE" IS '长协编号';
COMMENT ON COLUMN "SPMS"."SHOPPING_CART"."BRAND" IS '品牌';
COMMENT ON TABLE "SPMS"."SHOPPING_CART" IS '购物车表';

-- ----------------------------
-- Table structure for SHOPPING_SCENARIO
-- ----------------------------
DROP TABLE "SPMS"."SHOPPING_SCENARIO";
CREATE TABLE "SPMS"."SHOPPING_SCENARIO" (
  "UUID" VARCHAR2(32 BYTE) VISIBLE NOT NULL,
  "SCENARIO_ID" VARCHAR2(16 BYTE) VISIBLE,
  "WERKS" VARCHAR2(6 BYTE) VISIBLE,
  "SCENARIO_NAME" VARCHAR2(256 BYTE) VISIBLE,
  "SCENARIO_DESC" VARCHAR2(256 BYTE) VISIBLE,
  "MACHINE_NO" VARCHAR2(64 BYTE) VISIBLE,
  "MACHINE_DESC" VARCHAR2(128 BYTE) VISIBLE,
  "REMARKS" VARCHAR2(128 BYTE) VISIBLE,
  "IS_DELETE" VARCHAR2(2 BYTE) VISIBLE DEFAULT 0,
  "CREATE_USERID" VARCHAR2(64 BYTE) VISIBLE,
  "CREATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss'),
  "UPDATE_USERID" VARCHAR2(64 BYTE) VISIBLE,
  "UPDATE_TIME" DATE VISIBLE
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."SHOPPING_SCENARIO"."UUID" IS '请购场景表唯一主键UUID';
COMMENT ON COLUMN "SPMS"."SHOPPING_SCENARIO"."SCENARIO_ID" IS '请购场景编号-工厂代码+四位序列号';
COMMENT ON COLUMN "SPMS"."SHOPPING_SCENARIO"."WERKS" IS '工厂代码，必输字段';
COMMENT ON COLUMN "SPMS"."SHOPPING_SCENARIO"."SCENARIO_NAME" IS '场景名称';
COMMENT ON COLUMN "SPMS"."SHOPPING_SCENARIO"."SCENARIO_DESC" IS '场景描述';
COMMENT ON COLUMN "SPMS"."SHOPPING_SCENARIO"."MACHINE_NO" IS '关联设备编号';
COMMENT ON COLUMN "SPMS"."SHOPPING_SCENARIO"."MACHINE_DESC" IS '关联设备描述信息';
COMMENT ON COLUMN "SPMS"."SHOPPING_SCENARIO"."REMARKS" IS '备注说明';
COMMENT ON COLUMN "SPMS"."SHOPPING_SCENARIO"."IS_DELETE" IS '是否删除-默认0否，1是';
COMMENT ON COLUMN "SPMS"."SHOPPING_SCENARIO"."CREATE_USERID" IS '创建人工号';
COMMENT ON COLUMN "SPMS"."SHOPPING_SCENARIO"."CREATE_TIME" IS '创建时间-默认当前国际时间';
COMMENT ON COLUMN "SPMS"."SHOPPING_SCENARIO"."UPDATE_USERID" IS '更新人工号';
COMMENT ON TABLE "SPMS"."SHOPPING_SCENARIO" IS '请购场景表表头';

-- ----------------------------
-- Table structure for SHOPPING_SCENARIO_DTL
-- ----------------------------
DROP TABLE "SPMS"."SHOPPING_SCENARIO_DTL";
CREATE TABLE "SPMS"."SHOPPING_SCENARIO_DTL" (
  "UUID" VARCHAR2(32 BYTE) VISIBLE,
  "SSD_ROW_ID" NUMBER VISIBLE,
  "MATERIAL_NO" VARCHAR2(64 BYTE) VISIBLE,
  "QUANTITY" NUMBER VISIBLE,
  "LONG_CONTRACT_CODE" VARCHAR2(128 BYTE) VISIBLE,
  "BRAND" VARCHAR2(40 BYTE) VISIBLE
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."SHOPPING_SCENARIO_DTL"."UUID" IS '表头UUID，唯一关联字段';
COMMENT ON COLUMN "SPMS"."SHOPPING_SCENARIO_DTL"."SSD_ROW_ID" IS '行编号';
COMMENT ON COLUMN "SPMS"."SHOPPING_SCENARIO_DTL"."MATERIAL_NO" IS '物料编号';
COMMENT ON COLUMN "SPMS"."SHOPPING_SCENARIO_DTL"."QUANTITY" IS '数量';
COMMENT ON COLUMN "SPMS"."SHOPPING_SCENARIO_DTL"."LONG_CONTRACT_CODE" IS '长协编号';
COMMENT ON COLUMN "SPMS"."SHOPPING_SCENARIO_DTL"."BRAND" IS '品牌';
COMMENT ON TABLE "SPMS"."SHOPPING_SCENARIO_DTL" IS '请购场景表明细';

-- ----------------------------
-- Table structure for SPMS_PERMISSION
-- ----------------------------
DROP TABLE "SPMS"."SPMS_PERMISSION";
CREATE TABLE "SPMS"."SPMS_PERMISSION" (
  "PERMISSION_ID" VARCHAR2(32 BYTE) VISIBLE NOT NULL,
  "PARENT_ID" VARCHAR2(128 BYTE) VISIBLE,
  "MENU_NAME" VARCHAR2(128 BYTE) VISIBLE,
  "MENU_EN_NAME" VARCHAR2(128 BYTE) VISIBLE,
  "URL" VARCHAR2(255 BYTE) VISIBLE,
  "COMPONENT_URL" VARCHAR2(255 BYTE) VISIBLE,
  "COMPONENT_NAME" VARCHAR2(255 BYTE) VISIBLE,
  "REDIRECT" VARCHAR2(255 BYTE) VISIBLE,
  "MENU_TYPE" NUMBER VISIBLE,
  "PERMS" VARCHAR2(255 BYTE) VISIBLE,
  "PERMS_TYPE" VARCHAR2(32 BYTE) VISIBLE DEFAULT 0,
  "SORT_NO" NUMBER VISIBLE,
  "ALWAYS_SHOW" NUMBER VISIBLE,
  "ICON" VARCHAR2(128 BYTE) VISIBLE,
  "IS_ROUTE" NUMBER VISIBLE DEFAULT 1,
  "IS_LEAF" NUMBER VISIBLE,
  "DESCRIPTION" VARCHAR2(255 BYTE) VISIBLE,
  "CREATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'),
                                                   'yyyy-mm-dd hh24:mi:ss'),
  "CREATE_USER" VARCHAR2(40 BYTE) VISIBLE,
  "UPDATE_TIME" DATE VISIBLE DEFAULT NULL,
  "UPDATE_USER" VARCHAR2(40 BYTE) VISIBLE
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."SPMS_PERMISSION"."PERMISSION_ID" IS '权限ID';
COMMENT ON COLUMN "SPMS"."SPMS_PERMISSION"."PARENT_ID" IS '父组件';
COMMENT ON COLUMN "SPMS"."SPMS_PERMISSION"."MENU_NAME" IS '菜单标题';
COMMENT ON COLUMN "SPMS"."SPMS_PERMISSION"."MENU_EN_NAME" IS '菜单英文标题';
COMMENT ON COLUMN "SPMS"."SPMS_PERMISSION"."URL" IS '路径';
COMMENT ON COLUMN "SPMS"."SPMS_PERMISSION"."COMPONENT_URL" IS '组件地址';
COMMENT ON COLUMN "SPMS"."SPMS_PERMISSION"."COMPONENT_NAME" IS '组件名称';
COMMENT ON COLUMN "SPMS"."SPMS_PERMISSION"."REDIRECT" IS '一级菜单跳转地址';
COMMENT ON COLUMN "SPMS"."SPMS_PERMISSION"."MENU_TYPE" IS '菜单类型（0：一级菜单；1：二级子菜单；3：三级子菜单；4：按钮权限；）';
COMMENT ON COLUMN "SPMS"."SPMS_PERMISSION"."PERMS" IS '菜单权限编码';
COMMENT ON COLUMN "SPMS"."SPMS_PERMISSION"."PERMS_TYPE" IS '权限策略 1：显示；2禁用；';
COMMENT ON COLUMN "SPMS"."SPMS_PERMISSION"."SORT_NO" IS '菜单排序';
COMMENT ON COLUMN "SPMS"."SPMS_PERMISSION"."ALWAYS_SHOW" IS '聚合子路由：1是，0否';
COMMENT ON COLUMN "SPMS"."SPMS_PERMISSION"."ICON" IS '菜单图标';
COMMENT ON COLUMN "SPMS"."SPMS_PERMISSION"."IS_ROUTE" IS '是否路由菜单：0不是，默认1是';
COMMENT ON COLUMN "SPMS"."SPMS_PERMISSION"."IS_LEAF" IS '是否叶子节点：1是，0不是';
COMMENT ON COLUMN "SPMS"."SPMS_PERMISSION"."DESCRIPTION" IS '描述';
COMMENT ON COLUMN "SPMS"."SPMS_PERMISSION"."CREATE_TIME" IS '创建时间';
COMMENT ON COLUMN "SPMS"."SPMS_PERMISSION"."CREATE_USER" IS '创建人工号';
COMMENT ON COLUMN "SPMS"."SPMS_PERMISSION"."UPDATE_TIME" IS '更新时间';
COMMENT ON COLUMN "SPMS"."SPMS_PERMISSION"."UPDATE_USER" IS '更新人工号';
COMMENT ON TABLE "SPMS"."SPMS_PERMISSION" IS 'spms权限表';

-- ----------------------------
-- Table structure for SPMS_ROLE
-- ----------------------------
DROP TABLE "SPMS"."SPMS_ROLE";
CREATE TABLE "SPMS"."SPMS_ROLE" (
  "UUID" VARCHAR2(32 BYTE) VISIBLE NOT NULL,
  "ROLE_ID" VARCHAR2(32 BYTE) VISIBLE NOT NULL,
  "ROLE_CN_NAME" VARCHAR2(128 BYTE) VISIBLE,
  "ROLE_EN_NAME" VARCHAR2(128 BYTE) VISIBLE,
  "ROLE_INFO" VARCHAR2(255 BYTE) VISIBLE,
  "CREATE_USER" VARCHAR2(16 BYTE) VISIBLE,
  "CREATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'),
                                      'yyyy-mm-dd hh24:mi:ss'),
  "UPDATE_USER" VARCHAR2(16 BYTE) VISIBLE,
  "UPDATE_TIME" DATE VISIBLE
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."SPMS_ROLE"."UUID" IS '唯一UUID';
COMMENT ON COLUMN "SPMS"."SPMS_ROLE"."ROLE_ID" IS '角色编号-主键';
COMMENT ON COLUMN "SPMS"."SPMS_ROLE"."ROLE_CN_NAME" IS '角色中文描述';
COMMENT ON COLUMN "SPMS"."SPMS_ROLE"."ROLE_EN_NAME" IS '角色英文描述';
COMMENT ON COLUMN "SPMS"."SPMS_ROLE"."ROLE_INFO" IS '角色信息';
COMMENT ON COLUMN "SPMS"."SPMS_ROLE"."CREATE_USER" IS '创建人工号';
COMMENT ON COLUMN "SPMS"."SPMS_ROLE"."CREATE_TIME" IS '创建时间';
COMMENT ON COLUMN "SPMS"."SPMS_ROLE"."UPDATE_USER" IS '更新人工号';
COMMENT ON COLUMN "SPMS"."SPMS_ROLE"."UPDATE_TIME" IS '更新时间';

-- ----------------------------
-- Table structure for SPMS_ROLE_PERMISSION
-- ----------------------------
DROP TABLE "SPMS"."SPMS_ROLE_PERMISSION";
CREATE TABLE "SPMS"."SPMS_ROLE_PERMISSION" (
  "UUID" VARCHAR2(32 BYTE) VISIBLE NOT NULL,
  "ROLE_UUID" VARCHAR2(32 BYTE) VISIBLE,
  "PERMISSION_ID" VARCHAR2(32 BYTE) VISIBLE
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."SPMS_ROLE_PERMISSION"."UUID" IS '唯一UUID';
COMMENT ON COLUMN "SPMS"."SPMS_ROLE_PERMISSION"."ROLE_UUID" IS '角色表uuid';
COMMENT ON COLUMN "SPMS"."SPMS_ROLE_PERMISSION"."PERMISSION_ID" IS '权限编号';
COMMENT ON TABLE "SPMS"."SPMS_ROLE_PERMISSION" IS 'spms角色权限关系表';

-- ----------------------------
-- Table structure for SPMS_USER
-- ----------------------------
DROP TABLE "SPMS"."SPMS_USER";
CREATE TABLE "SPMS"."SPMS_USER" (
  "WORK_CODE" VARCHAR2(60 BYTE) VISIBLE NOT NULL,
  "WORK_ID" VARCHAR2(20 BYTE) VISIBLE,
  "LAST_NAME" VARCHAR2(60 BYTE) VISIBLE,
  "TELEPHONE" VARCHAR2(60 BYTE) VISIBLE,
  "MOBILE" VARCHAR2(60 BYTE) VISIBLE,
  "EMAIL" VARCHAR2(60 BYTE) VISIBLE,
  "POSITION_ID" VARCHAR2(30 BYTE) VISIBLE,
  "POSITION_NAME" VARCHAR2(128 BYTE) VISIBLE,
  "DEPT_ID" VARCHAR2(30 BYTE) VISIBLE,
  "DEPT_NAME" VARCHAR2(128 BYTE) VISIBLE,
  "SUBCOMPANY_ID" VARCHAR2(20 BYTE) VISIBLE,
  "SUBCOMPANY_NAME" VARCHAR2(128 BYTE) VISIBLE,
  "COMPANY" VARCHAR2(100 BYTE) VISIBLE,
  "BRANCH_POINT" VARCHAR2(100 BYTE) VISIBLE,
  "BRANCH_LINE" VARCHAR2(100 BYTE) VISIBLE,
  "MANAGER_ID" VARCHAR2(20 BYTE) VISIBLE,
  "MANAGER_NAME" VARCHAR2(60 BYTE) VISIBLE,
  "OA_STATUS" VARCHAR2(20 BYTE) VISIBLE,
  "LOGIN_PASSWORD" VARCHAR2(255 BYTE) VISIBLE,
  "SPMS_STATUS" VARCHAR2(2 BYTE) VISIBLE DEFAULT 1
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."SPMS_USER"."WORK_CODE" IS '员工编号';
COMMENT ON COLUMN "SPMS"."SPMS_USER"."WORK_ID" IS '员工ID';
COMMENT ON COLUMN "SPMS"."SPMS_USER"."LAST_NAME" IS '员工姓名';
COMMENT ON COLUMN "SPMS"."SPMS_USER"."TELEPHONE" IS '电话';
COMMENT ON COLUMN "SPMS"."SPMS_USER"."MOBILE" IS '手机';
COMMENT ON COLUMN "SPMS"."SPMS_USER"."EMAIL" IS '邮箱';
COMMENT ON COLUMN "SPMS"."SPMS_USER"."POSITION_ID" IS '岗位ID';
COMMENT ON COLUMN "SPMS"."SPMS_USER"."POSITION_NAME" IS '岗位名称';
COMMENT ON COLUMN "SPMS"."SPMS_USER"."DEPT_ID" IS '部门ID';
COMMENT ON COLUMN "SPMS"."SPMS_USER"."DEPT_NAME" IS '部门名称';
COMMENT ON COLUMN "SPMS"."SPMS_USER"."SUBCOMPANY_ID" IS '分部ID';
COMMENT ON COLUMN "SPMS"."SPMS_USER"."SUBCOMPANY_NAME" IS '分部名称';
COMMENT ON COLUMN "SPMS"."SPMS_USER"."COMPANY" IS '分公司';
COMMENT ON COLUMN "SPMS"."SPMS_USER"."BRANCH_POINT" IS '分点';
COMMENT ON COLUMN "SPMS"."SPMS_USER"."BRANCH_LINE" IS '分线';
COMMENT ON COLUMN "SPMS"."SPMS_USER"."MANAGER_ID" IS '直接上级ID';
COMMENT ON COLUMN "SPMS"."SPMS_USER"."MANAGER_NAME" IS '直接上级名称';
COMMENT ON COLUMN "SPMS"."SPMS_USER"."OA_STATUS" IS '状态-0：试用 1：正式 2：临时 3：试用延期';
COMMENT ON COLUMN "SPMS"."SPMS_USER"."LOGIN_PASSWORD" IS '登陆密码';
COMMENT ON COLUMN "SPMS"."SPMS_USER"."SPMS_STATUS" IS '员工在SPMS系统状态-默认1正常；0停用；';
COMMENT ON TABLE "SPMS"."SPMS_USER" IS 'SPMS用户信息表';

-- ----------------------------
-- Table structure for SPMS_USER_ROLE
-- ----------------------------
DROP TABLE "SPMS"."SPMS_USER_ROLE";
CREATE TABLE "SPMS"."SPMS_USER_ROLE" (
  "UUID" VARCHAR2(32 BYTE) VISIBLE NOT NULL,
  "WORK_CODE" VARCHAR2(60 BYTE) VISIBLE,
  "ROLE_ID" VARCHAR2(32 BYTE) VISIBLE,
  "ROLE_UUID" VARCHAR2(32 BYTE) VISIBLE
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."SPMS_USER_ROLE"."UUID" IS '唯一UUID';
COMMENT ON COLUMN "SPMS"."SPMS_USER_ROLE"."WORK_CODE" IS '用户工号';
COMMENT ON COLUMN "SPMS"."SPMS_USER_ROLE"."ROLE_ID" IS '角色编号';
COMMENT ON COLUMN "SPMS"."SPMS_USER_ROLE"."ROLE_UUID" IS '角色表UUID';
COMMENT ON TABLE "SPMS"."SPMS_USER_ROLE" IS 'spms用户角色关系表';

-- ----------------------------
-- Table structure for SPMS_USER_WHS
-- ----------------------------
DROP TABLE "SPMS"."SPMS_USER_WHS";
CREATE TABLE "SPMS"."SPMS_USER_WHS" (
  "WORK_CODE" VARCHAR2(60 BYTE) VISIBLE,
  "WERKS" VARCHAR2(6 BYTE) VISIBLE,
  "WHS_LOCATION_CODE" VARCHAR2(6 BYTE) VISIBLE
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."SPMS_USER_WHS"."WORK_CODE" IS '用户工号';
COMMENT ON COLUMN "SPMS"."SPMS_USER_WHS"."WERKS" IS '工厂代码';
COMMENT ON COLUMN "SPMS"."SPMS_USER_WHS"."WHS_LOCATION_CODE" IS '车间地点代码';
COMMENT ON TABLE "SPMS"."SPMS_USER_WHS" IS '用户仓库关联关系表';

-- ----------------------------
-- Table structure for SPMS_USER_WORKSHOP
-- ----------------------------
DROP TABLE "SPMS"."SPMS_USER_WORKSHOP";
CREATE TABLE "SPMS"."SPMS_USER_WORKSHOP" (
  "WORK_CODE" VARCHAR2(60 BYTE) VISIBLE,
  "WERKS" VARCHAR2(6 BYTE) VISIBLE,
  "WORKSHOP_CODE" VARCHAR2(16 BYTE) VISIBLE
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."SPMS_USER_WORKSHOP"."WORK_CODE" IS '用户工号';
COMMENT ON COLUMN "SPMS"."SPMS_USER_WORKSHOP"."WERKS" IS '工厂代码';
COMMENT ON COLUMN "SPMS"."SPMS_USER_WORKSHOP"."WORKSHOP_CODE" IS '车间代码';
COMMENT ON TABLE "SPMS"."SPMS_USER_WORKSHOP" IS '用户车间关联关系表';

-- ----------------------------
-- Table structure for SYS_LOG
-- ----------------------------
DROP TABLE "SPMS"."SYS_LOG";
CREATE TABLE "SPMS"."SYS_LOG" (
  "UUID" VARCHAR2(32 BYTE) VISIBLE DEFAULT NULL NOT NULL,
  "LOG_TYPE" VARCHAR2(2 BYTE) VISIBLE,
  "LOG_CONTENT" VARCHAR2(1000 BYTE) VISIBLE,
  "OPERATE_TYPE" VARCHAR2(64 BYTE) VISIBLE,
  "USER_ID" VARCHAR2(40 BYTE) VISIBLE,
  "USERNAME" VARCHAR2(128 BYTE) VISIBLE,
  "IP" VARCHAR2(100 BYTE) VISIBLE,
  "METHOD" VARCHAR2(255 BYTE) VISIBLE,
  "REQUEST_URL" VARCHAR2(255 BYTE) VISIBLE,
  "REQUEST_TYPE" VARCHAR2(10 BYTE) VISIBLE,
  "COST_TIME" NUMBER VISIBLE,
  "CREATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss'),
  "LOG_AUTO_ID" NUMBER VISIBLE,
  "RELATE_DOC_NUMBER" VARCHAR2(64 BYTE) VISIBLE,
  "REQUEST_PARAM" CLOB VISIBLE,
  "REMARKS" CLOB VISIBLE,
  "RETURNED_MESSAGE" CLOB VISIBLE
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."SYS_LOG"."UUID" IS '唯一ID';
COMMENT ON COLUMN "SPMS"."SYS_LOG"."LOG_TYPE" IS '日志类型（1操作日志,2登录日志,3提交OA记录,4请求SAP日志,5物料申请）';
COMMENT ON COLUMN "SPMS"."SYS_LOG"."LOG_CONTENT" IS '日志内容';
COMMENT ON COLUMN "SPMS"."SYS_LOG"."OPERATE_TYPE" IS '操作类型-登录；查询；添加；修改；删除；导入；导出；';
COMMENT ON COLUMN "SPMS"."SYS_LOG"."USER_ID" IS '用户工号';
COMMENT ON COLUMN "SPMS"."SYS_LOG"."USERNAME" IS '用户名';
COMMENT ON COLUMN "SPMS"."SYS_LOG"."IP" IS 'IP地址';
COMMENT ON COLUMN "SPMS"."SYS_LOG"."METHOD" IS '请求方法';
COMMENT ON COLUMN "SPMS"."SYS_LOG"."REQUEST_URL" IS '请求路径';
COMMENT ON COLUMN "SPMS"."SYS_LOG"."REQUEST_TYPE" IS '请求类型';
COMMENT ON COLUMN "SPMS"."SYS_LOG"."COST_TIME" IS '耗时(ms)';
COMMENT ON COLUMN "SPMS"."SYS_LOG"."CREATE_TIME" IS '创建时间';
COMMENT ON COLUMN "SPMS"."SYS_LOG"."LOG_AUTO_ID" IS '日志表自增ID';
COMMENT ON COLUMN "SPMS"."SYS_LOG"."RELATE_DOC_NUMBER" IS '关联单据号';
COMMENT ON COLUMN "SPMS"."SYS_LOG"."REQUEST_PARAM" IS '请求参数';
COMMENT ON COLUMN "SPMS"."SYS_LOG"."REMARKS" IS '备注信息';
COMMENT ON COLUMN "SPMS"."SYS_LOG"."RETURNED_MESSAGE" IS '返回参数';
COMMENT ON TABLE "SPMS"."SYS_LOG" IS '系统日志表';

-- ----------------------------
-- Table structure for SYS_LOG_MQ
-- ----------------------------
DROP TABLE "SPMS"."SYS_LOG_MQ";
CREATE TABLE "SPMS"."SYS_LOG_MQ" (
  "LOG_AUTO_ID" NUMBER VISIBLE,
  "UUID" VARCHAR2(32 BYTE) VISIBLE NOT NULL,
  "LOG_TYPE" VARCHAR2(2 BYTE) VISIBLE,
  "REQUEST_INTERFACE" VARCHAR2(255 BYTE) VISIBLE,
  "REQUEST_DESC" VARCHAR2(255 BYTE) VISIBLE,
  "FUNCTION_ID" VARCHAR2(128 BYTE) VISIBLE,
  "USER_ID" VARCHAR2(60 BYTE) VISIBLE,
  "CREATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss'),
  "REQUEST_PARAM" CLOB VISIBLE,
  "REMARKS" CLOB VISIBLE,
  "RECEIVED_MESSAGE" CLOB VISIBLE
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."SYS_LOG_MQ"."LOG_AUTO_ID" IS 'MQ日志表自增ID';
COMMENT ON COLUMN "SPMS"."SYS_LOG_MQ"."UUID" IS '唯一UUID';
COMMENT ON COLUMN "SPMS"."SYS_LOG_MQ"."LOG_TYPE" IS '日志类型（1发送MQ日志，2接收MQ日志，3发送rest请求，4接收rest请求）';
COMMENT ON COLUMN "SPMS"."SYS_LOG_MQ"."REQUEST_INTERFACE" IS '接口名称';
COMMENT ON COLUMN "SPMS"."SYS_LOG_MQ"."REQUEST_DESC" IS '功能描述';
COMMENT ON COLUMN "SPMS"."SYS_LOG_MQ"."FUNCTION_ID" IS 'FunctionId';
COMMENT ON COLUMN "SPMS"."SYS_LOG_MQ"."USER_ID" IS '创建人工号';
COMMENT ON COLUMN "SPMS"."SYS_LOG_MQ"."CREATE_TIME" IS '创建时间';
COMMENT ON TABLE "SPMS"."SYS_LOG_MQ" IS 'MQ系统日志表';

-- ----------------------------
-- Table structure for WERKS
-- ----------------------------
DROP TABLE "SPMS"."WERKS";
CREATE TABLE "SPMS"."WERKS" (
  "WERKS" VARCHAR2(6 BYTE) VISIBLE NOT NULL,
  "WERKS_NAME_ZH" VARCHAR2(128 BYTE) VISIBLE,
  "WERKS_NAME_EN" VARCHAR2(128 BYTE) VISIBLE,
  "COMPANY_CODE" VARCHAR2(6 BYTE) VISIBLE,
  "COMPANY_NAME_ZH" VARCHAR2(128 BYTE) VISIBLE,
  "COMPANY_NAME_EN" VARCHAR2(128 BYTE) VISIBLE,
  "REGIO_GROUP" VARCHAR2(10 BYTE) VISIBLE,
  "COUNTRY" VARCHAR2(64 BYTE) VISIBLE,
  "CREATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss'),
  "SUPPLIER_NO" VARCHAR2(32 BYTE) VISIBLE
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."WERKS"."WERKS" IS '工厂代码';
COMMENT ON COLUMN "SPMS"."WERKS"."WERKS_NAME_ZH" IS '工厂中文名称';
COMMENT ON COLUMN "SPMS"."WERKS"."WERKS_NAME_EN" IS '工厂英文名称';
COMMENT ON COLUMN "SPMS"."WERKS"."COMPANY_CODE" IS '公司代码';
COMMENT ON COLUMN "SPMS"."WERKS"."COMPANY_NAME_ZH" IS '公司中文名称';
COMMENT ON COLUMN "SPMS"."WERKS"."COMPANY_NAME_EN" IS '公司英文名称';
COMMENT ON COLUMN "SPMS"."WERKS"."REGIO_GROUP" IS '工厂分类（10保税工厂，20贸易工厂，30生产工厂，40虚拟销售工厂）';
COMMENT ON COLUMN "SPMS"."WERKS"."COUNTRY" IS '国家';
COMMENT ON COLUMN "SPMS"."WERKS"."SUPPLIER_NO" IS '供应商编号';
COMMENT ON TABLE "SPMS"."WERKS" IS '工厂信息表';

-- ----------------------------
-- Table structure for WHS
-- ----------------------------
DROP TABLE "SPMS"."WHS";
CREATE TABLE "SPMS"."WHS" (
  "WERKS" VARCHAR2(6 BYTE) VISIBLE,
  "WHS_LOCATION_CODE" VARCHAR2(6 BYTE) VISIBLE,
  "WHS_LOCATION_DESC" VARCHAR2(128 BYTE) VISIBLE,
  "WHS_TYPE" VARCHAR2(32 BYTE) VISIBLE,
  "CONTACT" VARCHAR2(64 BYTE) VISIBLE,
  "ADDRESS" VARCHAR2(255 BYTE) VISIBLE,
  "TELEPHONE" VARCHAR2(50 BYTE) VISIBLE,
  "CITY" VARCHAR2(64 BYTE) VISIBLE,
  "CREATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss')
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."WHS"."WERKS" IS '工厂代码（和仓库地点代码一起确定唯一性）';
COMMENT ON COLUMN "SPMS"."WHS"."WHS_LOCATION_CODE" IS '仓储地点代码（和工厂代码一起确定唯一性）';
COMMENT ON COLUMN "SPMS"."WHS"."WHS_LOCATION_DESC" IS '仓库地点描述';
COMMENT ON COLUMN "SPMS"."WHS"."WHS_TYPE" IS '仓储类型-自定义字段（贸易仓、备件仓、复合仓）';
COMMENT ON COLUMN "SPMS"."WHS"."CONTACT" IS '联系人';
COMMENT ON COLUMN "SPMS"."WHS"."ADDRESS" IS '地址';
COMMENT ON COLUMN "SPMS"."WHS"."TELEPHONE" IS '电话';
COMMENT ON COLUMN "SPMS"."WHS"."CITY" IS '城市';
COMMENT ON TABLE "SPMS"."WHS" IS '仓库信息表';

-- ----------------------------
-- Table structure for WHS_DUMP
-- ----------------------------
DROP TABLE "SPMS"."WHS_DUMP";
CREATE TABLE "SPMS"."WHS_DUMP" (
  "WHS_DUMP_UUID" VARCHAR2(32 BYTE) VISIBLE NOT NULL,
  "WHS_DUMP_NO" VARCHAR2(32 BYTE) VISIBLE,
  "GOODS_TYPE" VARCHAR2(2 BYTE) VISIBLE,
  "BUSINESS_TYPE" VARCHAR2(16 BYTE) VISIBLE,
  "WERKS_DUMP_OUT" VARCHAR2(6 BYTE) VISIBLE,
  "WHS_LOCATION_CODE_DUMP_OUT" VARCHAR2(6 BYTE) VISIBLE,
  "DUMP_OUT_REMARK" VARCHAR2(255 BYTE) VISIBLE,
  "CREATE_USERID" VARCHAR2(10 BYTE) VISIBLE,
  "CREATE_DATE" VARCHAR2(16 BYTE) VISIBLE,
  "DUMP_OUT_OPERATOR" VARCHAR2(10 BYTE) VISIBLE,
  "DUMP_OUT_DATE" VARCHAR2(16 BYTE) VISIBLE,
  "SPMS_STATUS" VARCHAR2(2 BYTE) VISIBLE,
  "DUMP_OUT_SAP_DATE" VARCHAR2(16 BYTE) VISIBLE,
  "SAP_DUMP_OUT_NO" VARCHAR2(32 BYTE) VISIBLE,
  "SAP_DELIVERY_NOTE" VARCHAR2(16 BYTE) VISIBLE,
  "SAP_WHS_OUT_NO" VARCHAR2(32 BYTE) VISIBLE,
  "WERKS_DUMP_IN" VARCHAR2(6 BYTE) VISIBLE,
  "WHS_LOCATION_CODE_DUMP_IN" VARCHAR2(6 BYTE) VISIBLE,
  "DUMP_IN_REMARK" VARCHAR2(255 BYTE) VISIBLE,
  "DUMP_IN_OPERATOR" VARCHAR2(10 BYTE) VISIBLE,
  "DUMP_IN_DATE" VARCHAR2(16 BYTE) VISIBLE,
  "SAP_WHS_IN_NO" VARCHAR2(32 BYTE) VISIBLE,
  "SUPPLIER_CODE" VARCHAR2(16 BYTE) VISIBLE,
  "VOUCHER_TYPE" VARCHAR2(16 BYTE) VISIBLE,
  "PURCHASE_GROUP" VARCHAR2(16 BYTE) VISIBLE,
  "PURCHASE_ORG" VARCHAR2(16 BYTE) VISIBLE,
  "RETURN_MARK" VARCHAR2(16 BYTE) VISIBLE,
  "REMARK" VARCHAR2(255 BYTE) VISIBLE,
  "DUMP_IN_SAP_DATE" VARCHAR2(16 BYTE) VISIBLE,
  "DELIVERY_DATE" VARCHAR2(16 BYTE) VISIBLE,
  "CANCEL_VOUCHER_NUMBER" VARCHAR2(16 BYTE) VISIBLE,
  "CANCEL_POSTING_DATE" VARCHAR2(10 BYTE) VISIBLE,
  "CANCEL_VOUCHER_YEAR" VARCHAR2(16 BYTE) VISIBLE,
  "SAP_WHS_OUT_YEAR" VARCHAR2(16 BYTE) VISIBLE
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."WHS_DUMP"."WHS_DUMP_UUID" IS '转储任务UUID';
COMMENT ON COLUMN "SPMS"."WHS_DUMP"."WHS_DUMP_NO" IS '转储任务单号';
COMMENT ON COLUMN "SPMS"."WHS_DUMP"."GOODS_TYPE" IS '货物类型';
COMMENT ON COLUMN "SPMS"."WHS_DUMP"."BUSINESS_TYPE" IS '业务标识';
COMMENT ON COLUMN "SPMS"."WHS_DUMP"."WERKS_DUMP_OUT" IS '转出工厂代码-CN01';
COMMENT ON COLUMN "SPMS"."WHS_DUMP"."WHS_LOCATION_CODE_DUMP_OUT" IS '转出仓库代码';
COMMENT ON COLUMN "SPMS"."WHS_DUMP"."DUMP_OUT_REMARK" IS '转出备注信息';
COMMENT ON COLUMN "SPMS"."WHS_DUMP"."CREATE_USERID" IS '创建人工号';
COMMENT ON COLUMN "SPMS"."WHS_DUMP"."CREATE_DATE" IS '创建日期';
COMMENT ON COLUMN "SPMS"."WHS_DUMP"."DUMP_OUT_OPERATOR" IS '转出执行人';
COMMENT ON COLUMN "SPMS"."WHS_DUMP"."DUMP_OUT_DATE" IS '转出完成日期';
COMMENT ON COLUMN "SPMS"."WHS_DUMP"."SPMS_STATUS" IS 'SPMS转储单据状态（0删除；1草稿；2转出可执行；3转出完成；4提交SAP获取PO成功；5提交SAP获取PO失败；6提交SAP获取DN成功；7提交SAP获取DN失败；8转出已撤销；）';
COMMENT ON COLUMN "SPMS"."WHS_DUMP"."DUMP_OUT_SAP_DATE" IS '转出提交SAP日期/过账日期';
COMMENT ON COLUMN "SPMS"."WHS_DUMP"."SAP_DUMP_OUT_NO" IS 'SAP转储单号/采购凭证号';
COMMENT ON COLUMN "SPMS"."WHS_DUMP"."SAP_DELIVERY_NOTE" IS 'SAP交货单号';
COMMENT ON COLUMN "SPMS"."WHS_DUMP"."SAP_WHS_OUT_NO" IS 'SAP转出物料凭证号/获取DN时';
COMMENT ON COLUMN "SPMS"."WHS_DUMP"."WERKS_DUMP_IN" IS '转入工厂代码/客户编号';
COMMENT ON COLUMN "SPMS"."WHS_DUMP"."WHS_LOCATION_CODE_DUMP_IN" IS '转入仓库代码';
COMMENT ON COLUMN "SPMS"."WHS_DUMP"."DUMP_IN_REMARK" IS '转入备注信息';
COMMENT ON COLUMN "SPMS"."WHS_DUMP"."DUMP_IN_OPERATOR" IS '转入执行人';
COMMENT ON COLUMN "SPMS"."WHS_DUMP"."DUMP_IN_DATE" IS '转入完成日期';
COMMENT ON COLUMN "SPMS"."WHS_DUMP"."SAP_WHS_IN_NO" IS 'SAP转入物料凭证号';
COMMENT ON COLUMN "SPMS"."WHS_DUMP"."SUPPLIER_CODE" IS '供应商编码';
COMMENT ON COLUMN "SPMS"."WHS_DUMP"."VOUCHER_TYPE" IS '凭证类型/订单类型(采购)ZC09';
COMMENT ON COLUMN "SPMS"."WHS_DUMP"."PURCHASE_GROUP" IS '采购组-260';
COMMENT ON COLUMN "SPMS"."WHS_DUMP"."PURCHASE_ORG" IS '采购组织-1000';
COMMENT ON COLUMN "SPMS"."WHS_DUMP"."RETURN_MARK" IS '退货标识';
COMMENT ON COLUMN "SPMS"."WHS_DUMP"."REMARK" IS '备注信息';
COMMENT ON COLUMN "SPMS"."WHS_DUMP"."DUMP_IN_SAP_DATE" IS '转入提交SAP日期';
COMMENT ON COLUMN "SPMS"."WHS_DUMP"."DELIVERY_DATE" IS '项目交货日期';
COMMENT ON COLUMN "SPMS"."WHS_DUMP"."CANCEL_VOUCHER_NUMBER" IS '撤销SAP凭证号';
COMMENT ON COLUMN "SPMS"."WHS_DUMP"."CANCEL_POSTING_DATE" IS '撤销SAP过账日期';
COMMENT ON COLUMN "SPMS"."WHS_DUMP"."CANCEL_VOUCHER_YEAR" IS '撤销SAP凭证年份';
COMMENT ON COLUMN "SPMS"."WHS_DUMP"."SAP_WHS_OUT_YEAR" IS 'SAP转出物料凭证年份/获取DN时';
COMMENT ON TABLE "SPMS"."WHS_DUMP" IS '转储任务表';

-- ----------------------------
-- Table structure for WHS_DUMP_DTL
-- ----------------------------
DROP TABLE "SPMS"."WHS_DUMP_DTL";
CREATE TABLE "SPMS"."WHS_DUMP_DTL" (
  "WHS_DUMP_UUID" VARCHAR2(32 BYTE) VISIBLE,
  "ITEM" NUMBER VISIBLE,
  "MATERIAL_NO" VARCHAR2(40 BYTE) VISIBLE,
  "BASIC_UNIT" VARCHAR2(6 BYTE) VISIBLE,
  "BOX_NOTE" VARCHAR2(32 BYTE) VISIBLE,
  "PLANNED_OUT_QTY" NUMBER VISIBLE,
  "PLANNED_OUT_STORAGE" VARCHAR2(4000 BYTE) VISIBLE,
  "ACTUAL_OUT_QTY" NUMBER VISIBLE,
  "ACTUAL_OUT_STORAGE" VARCHAR2(4000 BYTE) VISIBLE,
  "DUMP_OUT_REMARK" VARCHAR2(255 BYTE) VISIBLE,
  "ACTUAL_IN_QTY" NUMBER VISIBLE,
  "ACTUAL_IN_STORAGE" VARCHAR2(4000 BYTE) VISIBLE,
  "DUMP_IN_REMARK" VARCHAR2(255 BYTE) VISIBLE,
  "SAP_DELIVERY_NOTE" VARCHAR2(32 BYTE) VISIBLE,
  "SAP_DELIVERY_NOTE_ITEM" VARCHAR2(6 BYTE) VISIBLE,
  "SAP_WHS_OUT_NO" VARCHAR2(32 BYTE) VISIBLE,
  "SAP_WHS_OUT_NO_ITEM" VARCHAR2(6 BYTE) VISIBLE,
  "SAP_WHS_IN_NO" VARCHAR2(32 BYTE) VISIBLE,
  "SAP_WHS_IN_NO_ITEM" VARCHAR2(6 BYTE) VISIBLE,
  "SAP_DUMP_OUT_NO" VARCHAR2(32 BYTE) VISIBLE,
  "SAP_DUMP_OUT_NO_ITEM" VARCHAR2(6 BYTE) VISIBLE,
  "OVER_DELIVERY_LIMIT" NUMBER VISIBLE
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."WHS_DUMP_DTL"."WHS_DUMP_UUID" IS '转储任务UUID';
COMMENT ON COLUMN "SPMS"."WHS_DUMP_DTL"."ITEM" IS '任务行号';
COMMENT ON COLUMN "SPMS"."WHS_DUMP_DTL"."MATERIAL_NO" IS '物料编号';
COMMENT ON COLUMN "SPMS"."WHS_DUMP_DTL"."BASIC_UNIT" IS '基本单位';
COMMENT ON COLUMN "SPMS"."WHS_DUMP_DTL"."BOX_NOTE" IS '箱码';
COMMENT ON COLUMN "SPMS"."WHS_DUMP_DTL"."PLANNED_OUT_QTY" IS '计划转出数量（基本单位）';
COMMENT ON COLUMN "SPMS"."WHS_DUMP_DTL"."PLANNED_OUT_STORAGE" IS '计划转出储位信息';
COMMENT ON COLUMN "SPMS"."WHS_DUMP_DTL"."ACTUAL_OUT_QTY" IS '实际转出数量（基本单位）';
COMMENT ON COLUMN "SPMS"."WHS_DUMP_DTL"."ACTUAL_OUT_STORAGE" IS '实际转出储位信息';
COMMENT ON COLUMN "SPMS"."WHS_DUMP_DTL"."DUMP_OUT_REMARK" IS '转出备注信息';
COMMENT ON COLUMN "SPMS"."WHS_DUMP_DTL"."ACTUAL_IN_QTY" IS '实际转入数量（基本单位）';
COMMENT ON COLUMN "SPMS"."WHS_DUMP_DTL"."ACTUAL_IN_STORAGE" IS '实际转入储位信息';
COMMENT ON COLUMN "SPMS"."WHS_DUMP_DTL"."DUMP_IN_REMARK" IS '转入备注信息';
COMMENT ON COLUMN "SPMS"."WHS_DUMP_DTL"."SAP_DELIVERY_NOTE" IS 'SAP交货单号';
COMMENT ON COLUMN "SPMS"."WHS_DUMP_DTL"."SAP_DELIVERY_NOTE_ITEM" IS 'SAP交货单行号';
COMMENT ON COLUMN "SPMS"."WHS_DUMP_DTL"."SAP_WHS_OUT_NO" IS 'SAP转出物料凭证号';
COMMENT ON COLUMN "SPMS"."WHS_DUMP_DTL"."SAP_WHS_OUT_NO_ITEM" IS 'SAP转出物料凭证行号';
COMMENT ON COLUMN "SPMS"."WHS_DUMP_DTL"."SAP_WHS_IN_NO" IS 'SAP转入物料凭证号';
COMMENT ON COLUMN "SPMS"."WHS_DUMP_DTL"."SAP_WHS_IN_NO_ITEM" IS 'SAP转入物料凭证行号';
COMMENT ON COLUMN "SPMS"."WHS_DUMP_DTL"."SAP_DUMP_OUT_NO" IS 'SAP转储订单号/采购凭证号';
COMMENT ON COLUMN "SPMS"."WHS_DUMP_DTL"."SAP_DUMP_OUT_NO_ITEM" IS 'SAP转储订单行号';
COMMENT ON COLUMN "SPMS"."WHS_DUMP_DTL"."OVER_DELIVERY_LIMIT" IS '过量交货限度默认10（表示10%）';
COMMENT ON TABLE "SPMS"."WHS_DUMP_DTL" IS '转储任务明细表';

-- ----------------------------
-- Table structure for WHS_INVENTORY_INFO
-- ----------------------------
DROP TABLE "SPMS"."WHS_INVENTORY_INFO";
CREATE TABLE "SPMS"."WHS_INVENTORY_INFO" (
  "WERKS" VARCHAR2(6 BYTE) VISIBLE,
  "WHS_LOCATION_CODE" VARCHAR2(6 BYTE) VISIBLE,
  "MATERIAL_NO" VARCHAR2(32 BYTE) VISIBLE,
  "MATERIAL_ZH_DESC" VARCHAR2(255 BYTE) VISIBLE,
  "MATERIAL_EN_DESC" VARCHAR2(255 BYTE) VISIBLE,
  "BASIC_UNIT" VARCHAR2(32 BYTE) VISIBLE,
  "QUANTITY" NUMBER VISIBLE,
  "SAFETY_QUANTITY" NUMBER VISIBLE,
  "UPDATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss'),
  "UPDATE_USER" VARCHAR2(60 BYTE) VISIBLE,
  "BOX_NOTE" VARCHAR2(50 BYTE) VISIBLE,
  "CREATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss')
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."WHS_INVENTORY_INFO"."WERKS" IS '工厂代码';
COMMENT ON COLUMN "SPMS"."WHS_INVENTORY_INFO"."WHS_LOCATION_CODE" IS '仓储地点代码';
COMMENT ON COLUMN "SPMS"."WHS_INVENTORY_INFO"."MATERIAL_NO" IS '物料编码';
COMMENT ON COLUMN "SPMS"."WHS_INVENTORY_INFO"."MATERIAL_ZH_DESC" IS '物料中文描述';
COMMENT ON COLUMN "SPMS"."WHS_INVENTORY_INFO"."MATERIAL_EN_DESC" IS '物料英文描述';
COMMENT ON COLUMN "SPMS"."WHS_INVENTORY_INFO"."BASIC_UNIT" IS '基本单位';
COMMENT ON COLUMN "SPMS"."WHS_INVENTORY_INFO"."QUANTITY" IS '仓库库存数量';
COMMENT ON COLUMN "SPMS"."WHS_INVENTORY_INFO"."SAFETY_QUANTITY" IS '安全库存数量';
COMMENT ON COLUMN "SPMS"."WHS_INVENTORY_INFO"."UPDATE_TIME" IS '更新时间';
COMMENT ON COLUMN "SPMS"."WHS_INVENTORY_INFO"."UPDATE_USER" IS '更新人';
COMMENT ON COLUMN "SPMS"."WHS_INVENTORY_INFO"."BOX_NOTE" IS '箱码-仅用于自管仓备件货管理';
COMMENT ON COLUMN "SPMS"."WHS_INVENTORY_INFO"."CREATE_TIME" IS '创建时间';
COMMENT ON TABLE "SPMS"."WHS_INVENTORY_INFO" IS '仓库库存信息表';

-- ----------------------------
-- Table structure for WHS_MOVE
-- ----------------------------
DROP TABLE "SPMS"."WHS_MOVE";
CREATE TABLE "SPMS"."WHS_MOVE" (
  "WHS_MOVE_UUID" VARCHAR2(32 BYTE) VISIBLE NOT NULL,
  "WHS_MOVE_NO" VARCHAR2(32 BYTE) VISIBLE,
  "MOVE_TYPE" VARCHAR2(6 BYTE) VISIBLE,
  "GOODS_TYPE" VARCHAR2(2 BYTE) VISIBLE,
  "WERKS_MOVE_OUT" VARCHAR2(6 BYTE) VISIBLE,
  "WHS_LOCATION_CODE_MOVE_OUT" VARCHAR2(6 BYTE) VISIBLE,
  "MOVE_OUT_REMARK" VARCHAR2(255 BYTE) VISIBLE,
  "WERKS_MOVE_IN" VARCHAR2(6 BYTE) VISIBLE,
  "WHS_LOCATION_CODE_MOVE_IN" VARCHAR2(6 BYTE) VISIBLE,
  "MOVE_IN_REMARK" VARCHAR2(255 BYTE) VISIBLE,
  "CREATE_DATE" VARCHAR2(16 BYTE) VISIBLE,
  "POSTING_DATE" VARCHAR2(16 BYTE) VISIBLE,
  "SAP_VOUCHER" VARCHAR2(64 BYTE) VISIBLE,
  "CREATE_USERID" VARCHAR2(10 BYTE) VISIBLE,
  "MOVE_OUT_USERID" VARCHAR2(10 BYTE) VISIBLE,
  "MOVE_IN_USERID" VARCHAR2(10 BYTE) VISIBLE,
  "SPMS_STATUS" VARCHAR2(2 BYTE) VISIBLE,
  "CREATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss'),
  "REMARK" VARCHAR2(255 BYTE) VISIBLE,
  "SAP_VOUCHER_YEAR" VARCHAR2(16 BYTE) VISIBLE
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."WHS_MOVE"."WHS_MOVE_UUID" IS '移仓任务uuid';
COMMENT ON COLUMN "SPMS"."WHS_MOVE"."WHS_MOVE_NO" IS '移仓任务单号';
COMMENT ON COLUMN "SPMS"."WHS_MOVE"."MOVE_TYPE" IS '移动类型';
COMMENT ON COLUMN "SPMS"."WHS_MOVE"."GOODS_TYPE" IS '货物类型';
COMMENT ON COLUMN "SPMS"."WHS_MOVE"."WERKS_MOVE_OUT" IS '移出工厂代码';
COMMENT ON COLUMN "SPMS"."WHS_MOVE"."WHS_LOCATION_CODE_MOVE_OUT" IS '移出仓库代码';
COMMENT ON COLUMN "SPMS"."WHS_MOVE"."MOVE_OUT_REMARK" IS '移出备注';
COMMENT ON COLUMN "SPMS"."WHS_MOVE"."WERKS_MOVE_IN" IS '移入工厂代码';
COMMENT ON COLUMN "SPMS"."WHS_MOVE"."WHS_LOCATION_CODE_MOVE_IN" IS '移入仓库代码';
COMMENT ON COLUMN "SPMS"."WHS_MOVE"."MOVE_IN_REMARK" IS '移入备注';
COMMENT ON COLUMN "SPMS"."WHS_MOVE"."CREATE_DATE" IS '创建日期';
COMMENT ON COLUMN "SPMS"."WHS_MOVE"."POSTING_DATE" IS '过账日期';
COMMENT ON COLUMN "SPMS"."WHS_MOVE"."SAP_VOUCHER" IS 'SAP凭证';
COMMENT ON COLUMN "SPMS"."WHS_MOVE"."CREATE_USERID" IS '创建人工号';
COMMENT ON COLUMN "SPMS"."WHS_MOVE"."MOVE_OUT_USERID" IS '移出执行人工号';
COMMENT ON COLUMN "SPMS"."WHS_MOVE"."MOVE_IN_USERID" IS '移入执行人工号';
COMMENT ON COLUMN "SPMS"."WHS_MOVE"."SPMS_STATUS" IS '单据状态(0删除;1草稿;2移出可执行;3移出提交(移入可执行);4移入提交(待上传SAP);5提交SAP成功;6完成(计算库存);';
COMMENT ON COLUMN "SPMS"."WHS_MOVE"."CREATE_TIME" IS '创建时间';
COMMENT ON COLUMN "SPMS"."WHS_MOVE"."REMARK" IS '备注字段';
COMMENT ON COLUMN "SPMS"."WHS_MOVE"."SAP_VOUCHER_YEAR" IS 'SAP凭证年份';
COMMENT ON TABLE "SPMS"."WHS_MOVE" IS '移仓任务表头';

-- ----------------------------
-- Table structure for WHS_MOVE_DTL
-- ----------------------------
DROP TABLE "SPMS"."WHS_MOVE_DTL";
CREATE TABLE "SPMS"."WHS_MOVE_DTL" (
  "WHS_MOVE_UUID" VARCHAR2(32 BYTE) VISIBLE,
  "AUTO_ID" NUMBER VISIBLE NOT NULL,
  "ITEM_NO" NUMBER VISIBLE,
  "MATERIAL_NO" VARCHAR2(40 BYTE) VISIBLE,
  "BASIC_UNIT" VARCHAR2(6 BYTE) VISIBLE,
  "BOX_NOTE" VARCHAR2(50 BYTE) VISIBLE,
  "PLANNED_OUT_QTY" NUMBER VISIBLE,
  "PLANNED_OUT_STORAGE" VARCHAR2(4000 BYTE) VISIBLE,
  "ACTUAL_OUT_QTY" NUMBER VISIBLE,
  "MOVE_OUT_STORAGE" VARCHAR2(4000 BYTE) VISIBLE,
  "MOVE_OUT_REMARK" VARCHAR2(255 BYTE) VISIBLE,
  "ACTUAL_IN_QTY" NUMBER VISIBLE,
  "MOVE_IN_STORAGE" VARCHAR2(4000 BYTE) VISIBLE,
  "MOVE_IN_REMARK" VARCHAR2(255 BYTE) VISIBLE,
  "SUPPLIER_NO" VARCHAR2(64 BYTE) VISIBLE,
  "COST_CENTER" VARCHAR2(16 BYTE) VISIBLE,
  "REMARK" VARCHAR2(255 BYTE) VISIBLE
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."WHS_MOVE_DTL"."WHS_MOVE_UUID" IS '移仓任务uuid';
COMMENT ON COLUMN "SPMS"."WHS_MOVE_DTL"."AUTO_ID" IS '自增ID';
COMMENT ON COLUMN "SPMS"."WHS_MOVE_DTL"."ITEM_NO" IS '行号';
COMMENT ON COLUMN "SPMS"."WHS_MOVE_DTL"."MATERIAL_NO" IS '物料编号';
COMMENT ON COLUMN "SPMS"."WHS_MOVE_DTL"."BASIC_UNIT" IS '单位';
COMMENT ON COLUMN "SPMS"."WHS_MOVE_DTL"."BOX_NOTE" IS '箱码';
COMMENT ON COLUMN "SPMS"."WHS_MOVE_DTL"."PLANNED_OUT_QTY" IS '计划移出数量';
COMMENT ON COLUMN "SPMS"."WHS_MOVE_DTL"."PLANNED_OUT_STORAGE" IS '计划移出储位信息';
COMMENT ON COLUMN "SPMS"."WHS_MOVE_DTL"."ACTUAL_OUT_QTY" IS '实际移出数量';
COMMENT ON COLUMN "SPMS"."WHS_MOVE_DTL"."MOVE_OUT_STORAGE" IS '实际移出储位信息';
COMMENT ON COLUMN "SPMS"."WHS_MOVE_DTL"."MOVE_OUT_REMARK" IS '移出备注';
COMMENT ON COLUMN "SPMS"."WHS_MOVE_DTL"."ACTUAL_IN_QTY" IS '实际移入数量';
COMMENT ON COLUMN "SPMS"."WHS_MOVE_DTL"."MOVE_IN_STORAGE" IS '实际移入储位信息';
COMMENT ON COLUMN "SPMS"."WHS_MOVE_DTL"."MOVE_IN_REMARK" IS '移入备注';
COMMENT ON COLUMN "SPMS"."WHS_MOVE_DTL"."SUPPLIER_NO" IS '供应商账号';
COMMENT ON COLUMN "SPMS"."WHS_MOVE_DTL"."COST_CENTER" IS '成本中心';
COMMENT ON COLUMN "SPMS"."WHS_MOVE_DTL"."REMARK" IS '备注信息';
COMMENT ON TABLE "SPMS"."WHS_MOVE_DTL" IS '移仓任务明细';

-- ----------------------------
-- Table structure for WHS_OPERATE_LOG
-- ----------------------------
DROP TABLE "SPMS"."WHS_OPERATE_LOG";
CREATE TABLE "SPMS"."WHS_OPERATE_LOG" (
  "LOG_ID" VARCHAR2(32 BYTE) VISIBLE NOT NULL,
  "DOCUMENT_TYPE" VARCHAR2(2 BYTE) VISIBLE,
  "UUID_STORAGE" VARCHAR2(32 BYTE) VISIBLE,
  "MATERIAL_NO" VARCHAR2(40 BYTE) VISIBLE,
  "BOX_NOTE" VARCHAR2(50 BYTE) VISIBLE,
  "QUANTITY" NUMBER VISIBLE,
  "OPERATION_TYPE" VARCHAR2(2 BYTE) VISIBLE,
  "DELIVERY_NOTE_SAP" VARCHAR2(16 BYTE) VISIBLE,
  "RELATE_DOCUMENT_NUMBER" VARCHAR2(32 BYTE) VISIBLE,
  "COMMENTS" VARCHAR2(255 BYTE) VISIBLE,
  "USER_ID" VARCHAR2(60 BYTE) VISIBLE,
  "CREATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss'),
  "REMARK" VARCHAR2(255 BYTE) VISIBLE,
  "LOG_AUTO_ID" NUMBER VISIBLE,
  "WERKS" VARCHAR2(6 BYTE) VISIBLE,
  "WHS_LOCATION_CODE" VARCHAR2(6 BYTE) VISIBLE,
  "MOVEMENT_TYPE" VARCHAR2(32 BYTE) VISIBLE
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."WHS_OPERATE_LOG"."LOG_ID" IS '日志表主键UUID';
COMMENT ON COLUMN "SPMS"."WHS_OPERATE_LOG"."DOCUMENT_TYPE" IS '日志单据类型：1自管仓仓库库存日志；2自管仓储位库存日志；3海外仓仓库库存日志；4海外仓储位库存日志；';
COMMENT ON COLUMN "SPMS"."WHS_OPERATE_LOG"."UUID_STORAGE" IS '储位UUID-储位库存变化时使用';
COMMENT ON COLUMN "SPMS"."WHS_OPERATE_LOG"."MATERIAL_NO" IS '物料编码';
COMMENT ON COLUMN "SPMS"."WHS_OPERATE_LOG"."BOX_NOTE" IS '箱码，自管仓备件货出入库、上下架时使用';
COMMENT ON COLUMN "SPMS"."WHS_OPERATE_LOG"."QUANTITY" IS '数量';
COMMENT ON COLUMN "SPMS"."WHS_OPERATE_LOG"."OPERATION_TYPE" IS '操作类型:1入库(加仓库库存);2上架(加储位库存);3下架(减储位库存);4出库(减仓库库存);5移位(出储位);6移位(进储位);7盘点(盘盈入储位);8盘点(盘亏出储位);9盘点(盘盈入仓库);10盘点(盘亏出仓库);11移仓(出储位);12移仓(入储位);13移仓(出仓库);14移仓(入仓库);15转储(出仓库);16转储(出储位);17转储(入仓库);18转储(入储位);19撤销(入储位);20撤销(出储位);21海外箱码收货;22海外撤销箱码收货;';
COMMENT ON COLUMN "SPMS"."WHS_OPERATE_LOG"."DELIVERY_NOTE_SAP" IS '交货单号';
COMMENT ON COLUMN "SPMS"."WHS_OPERATE_LOG"."RELATE_DOCUMENT_NUMBER" IS '关联单据号(预留)/出库任务uuid';
COMMENT ON COLUMN "SPMS"."WHS_OPERATE_LOG"."COMMENTS" IS '操作内容/评论';
COMMENT ON COLUMN "SPMS"."WHS_OPERATE_LOG"."USER_ID" IS '用户工号';
COMMENT ON COLUMN "SPMS"."WHS_OPERATE_LOG"."CREATE_TIME" IS '创建时间';
COMMENT ON COLUMN "SPMS"."WHS_OPERATE_LOG"."REMARK" IS '备注说明';
COMMENT ON COLUMN "SPMS"."WHS_OPERATE_LOG"."LOG_AUTO_ID" IS '日志表自增ID';
COMMENT ON COLUMN "SPMS"."WHS_OPERATE_LOG"."WERKS" IS '工厂代码';
COMMENT ON COLUMN "SPMS"."WHS_OPERATE_LOG"."WHS_LOCATION_CODE" IS '仓库代码';
COMMENT ON COLUMN "SPMS"."WHS_OPERATE_LOG"."MOVEMENT_TYPE" IS '移动类型';
COMMENT ON TABLE "SPMS"."WHS_OPERATE_LOG" IS '库存操作日志表';

-- ----------------------------
-- Table structure for WHS_OTHER_DTL
-- ----------------------------
DROP TABLE "SPMS"."WHS_OTHER_DTL";
CREATE TABLE "SPMS"."WHS_OTHER_DTL" (
  "WHS_OTHER_UUID" VARCHAR2(32 BYTE) VISIBLE,
  "AUTO_ID" NUMBER VISIBLE NOT NULL,
  "ROW_ID" NUMBER VISIBLE,
  "BOX_NOTE" VARCHAR2(50 BYTE) VISIBLE,
  "MATERIAL_NO" VARCHAR2(40 BYTE) VISIBLE,
  "OPERATE_QTY" NUMBER VISIBLE,
  "BASIC_UNIT" VARCHAR2(6 BYTE) VISIBLE,
  "PACKAGE_UNIT" VARCHAR2(16 BYTE) VISIBLE,
  "PACKAGE_LIST" VARCHAR2(20 BYTE) VISIBLE,
  "PACKAGE_ROW_ID" NUMBER VISIBLE,
  "PACKAGE_QTY" NUMBER VISIBLE,
  "COST_CENTER" VARCHAR2(16 BYTE) VISIBLE,
  "SUPPLIER_NO" VARCHAR2(16 BYTE) VISIBLE,
  "SUPPLIER_DESC" VARCHAR2(128 BYTE) VISIBLE,
  "MATERIAL_NO_OUT" VARCHAR2(40 BYTE) VISIBLE,
  "QTY_OUT" NUMBER VISIBLE,
  "MATERIAL_NO_IN" VARCHAR2(40 BYTE) VISIBLE,
  "QTY_IN" NUMBER VISIBLE,
  "WERKS" VARCHAR2(6 BYTE) VISIBLE,
  "WHS_LOCATION_CODE" VARCHAR2(6 BYTE) VISIBLE,
  "ROW_REMARKS" VARCHAR2(255 BYTE) VISIBLE,
  "TEMP_STORAGE" VARCHAR2(4000 BYTE) VISIBLE,
  "DELIVERY_NOTE_SAP" VARCHAR2(10 BYTE) VISIBLE,
  "DELIVERY_NOTE_SAP_ITEM" NUMBER VISIBLE,
  "PURCHASE_GROUP" VARCHAR2(6 BYTE) VISIBLE,
  "PURCHASE_GROUP_NAME" VARCHAR2(64 BYTE) VISIBLE,
  "DELIVERY_QTY" NUMBER(13,3) VISIBLE,
  "DELIVERY_UNIT" VARCHAR2(3 BYTE) VISIBLE,
  "RECEIVED_QTY" NUMBER(13,3) VISIBLE,
  "OVER_DELIVERY_LIMIT" NUMBER VISIBLE,
  "UNDER_DELIVERY_LIMIT" NUMBER VISIBLE,
  "UNLIMITED" VARCHAR2(2 BYTE) VISIBLE,
  "WERKS_XQ" VARCHAR2(6 BYTE) VISIBLE,
  "QTY_SALES" NUMBER(13,3) VISIBLE,
  "UNIT_SALES" VARCHAR2(3 BYTE) VISIBLE,
  "CABINET_SERIAL_NUMBER" VARCHAR2(2 BYTE) VISIBLE,
  "GOODS_TYPE" VARCHAR2(30 BYTE) VISIBLE,
  "RECEIVING_WERKS" VARCHAR2(6 BYTE) VISIBLE,
  "ACTUAL_RECEIVING_WERKS" VARCHAR2(6 BYTE) VISIBLE,
  "CABINET_NUMBER" VARCHAR2(16 BYTE) VISIBLE,
  "LEAD_SEAL" VARCHAR2(16 BYTE) VISIBLE,
  "SHIPMENT_CATEGORY" VARCHAR2(64 BYTE) VISIBLE,
  "PLANNED_PACKING_QTY" NUMBER(17,3) VISIBLE,
  "ITEM" VARCHAR2(6 BYTE) VISIBLE,
  "DATE_OF_LOADING" VARCHAR2(10 BYTE) VISIBLE,
  "LOADING_WERKS" VARCHAR2(6 BYTE) VISIBLE,
  "LOADING_WHS_LOCATION_CODE" VARCHAR2(4 BYTE) VISIBLE,
  "PLANNED_PACKING_NUMBER" NUMBER(17,3) VISIBLE,
  "PACKING_UNIT" VARCHAR2(3 BYTE) VISIBLE,
  "CABINET_WEIGHT" NUMBER(17,6) VISIBLE,
  "WEIGHT_UNIT" VARCHAR2(6 BYTE) VISIBLE,
  "CABINET_VOLUME" NUMBER(17,6) VISIBLE,
  "VOLUME_UNIT" VARCHAR2(6 BYTE) VISIBLE,
  "TRAILER_LINE" VARCHAR2(6 BYTE) VISIBLE,
  "TRAILER_LINE_DESC" VARCHAR2(40 BYTE) VISIBLE,
  "SPMS_STATUS" VARCHAR2(2 BYTE) VISIBLE DEFAULT 0,
  "UNPLANNED" VARCHAR2(2 BYTE) VISIBLE,
  "ACTUAL_OPERATE_QTY" NUMBER(17,3) VISIBLE,
  "CONTAINER_BRAND" VARCHAR2(64 BYTE) VISIBLE,
  "COLOR_NUMBER" VARCHAR2(32 BYTE) VISIBLE,
  "THICKNESS" NUMBER(7,3) VISIBLE,
  "ACTUAL_AVG_GROSS_WEIGHT" NUMBER(7,3) VISIBLE,
  "ACTUAL_PACKING_NUMBER" NUMBER(17,3) VISIBLE,
  "CUSTOMS_DECLARATION_NUMBER" NUMBER(17,3) VISIBLE,
  "PACKING_SPEC" VARCHAR2(128 BYTE) VISIBLE,
  "LOADING_TYPE" VARCHAR2(128 BYTE) VISIBLE,
  "STORAGE_OUT" VARCHAR2(4000 BYTE) VISIBLE,
  "STORAGE_IN" VARCHAR2(4000 BYTE) VISIBLE
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."WHS_OTHER_DTL"."WHS_OTHER_UUID" IS '异常出入库主键';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_DTL"."AUTO_ID" IS '自增ID';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_DTL"."ROW_ID" IS '行ID';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_DTL"."BOX_NOTE" IS '箱码';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_DTL"."MATERIAL_NO" IS '物料编码';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_DTL"."OPERATE_QTY" IS '出入库操作数量';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_DTL"."BASIC_UNIT" IS '基本单位';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_DTL"."PACKAGE_UNIT" IS '包装单位';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_DTL"."PACKAGE_LIST" IS '装箱单号';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_DTL"."PACKAGE_ROW_ID" IS '装箱单行号';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_DTL"."PACKAGE_QTY" IS '包装数量';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_DTL"."COST_CENTER" IS '成本中心';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_DTL"."SUPPLIER_NO" IS '供应商代码';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_DTL"."SUPPLIER_DESC" IS '供应商描述';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_DTL"."MATERIAL_NO_OUT" IS '出库物料编码';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_DTL"."QTY_OUT" IS '出库数量';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_DTL"."MATERIAL_NO_IN" IS '入库物料编码';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_DTL"."QTY_IN" IS '入库数量';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_DTL"."WERKS" IS '工厂';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_DTL"."WHS_LOCATION_CODE" IS '仓库代码';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_DTL"."ROW_REMARKS" IS '行备注';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_DTL"."TEMP_STORAGE" IS '储位信息';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_DTL"."DELIVERY_NOTE_SAP" IS 'SAP交货单号';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_DTL"."DELIVERY_NOTE_SAP_ITEM" IS 'SAP交货单行号';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_DTL"."PURCHASE_GROUP" IS '采购组';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_DTL"."PURCHASE_GROUP_NAME" IS '采购组名称';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_DTL"."DELIVERY_QTY" IS '交货数量';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_DTL"."DELIVERY_UNIT" IS '销售单位';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_DTL"."RECEIVED_QTY" IS '实际收货数量';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_DTL"."OVER_DELIVERY_LIMIT" IS '过量交货限度';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_DTL"."UNDER_DELIVERY_LIMIT" IS '交货不足限度';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_DTL"."UNLIMITED" IS '无限制';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_DTL"."WERKS_XQ" IS '需求工厂';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_DTL"."QTY_SALES" IS '销售数量';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_DTL"."UNIT_SALES" IS '销售单位';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_DTL"."CABINET_SERIAL_NUMBER" IS '柜序号';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_DTL"."GOODS_TYPE" IS '货物类型/产品层次';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_DTL"."RECEIVING_WERKS" IS '收货工厂';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_DTL"."ACTUAL_RECEIVING_WERKS" IS '实际收货工厂';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_DTL"."CABINET_NUMBER" IS '柜号';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_DTL"."LEAD_SEAL" IS '铅封号';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_DTL"."SHIPMENT_CATEGORY" IS '出货品类';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_DTL"."PLANNED_PACKING_QTY" IS '计划装箱数量(基本单位)';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_DTL"."ITEM" IS '装箱单行号';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_DTL"."DATE_OF_LOADING" IS '可装柜日期';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_DTL"."LOADING_WERKS" IS '装柜工厂代码';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_DTL"."LOADING_WHS_LOCATION_CODE" IS '装柜仓库代码';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_DTL"."PLANNED_PACKING_NUMBER" IS '计划装箱件数';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_DTL"."PACKING_UNIT" IS '包装单位';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_DTL"."CABINET_WEIGHT" IS '柜重量';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_DTL"."WEIGHT_UNIT" IS '重量单位';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_DTL"."CABINET_VOLUME" IS '柜体积';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_DTL"."VOLUME_UNIT" IS '体积单位';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_DTL"."TRAILER_LINE" IS '出发国拖车线路';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_DTL"."TRAILER_LINE_DESC" IS '出发国拖车线路名称';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_DTL"."SPMS_STATUS" IS '装箱单行项目在SPMS状态';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_DTL"."UNPLANNED" IS '是否为计划外的明细。默认空，额外出库的贸易货需传值1';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_DTL"."ACTUAL_OPERATE_QTY" IS '贸易货实际装箱数量(基本单位)';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_DTL"."CONTAINER_BRAND" IS '外箱品牌';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_DTL"."COLOR_NUMBER" IS '色号（砖类）';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_DTL"."THICKNESS" IS '砖厚';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_DTL"."ACTUAL_AVG_GROSS_WEIGHT" IS '产品实际平均毛重';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_DTL"."ACTUAL_PACKING_NUMBER" IS '实际装箱件数（销售单位）';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_DTL"."CUSTOMS_DECLARATION_NUMBER" IS '报关件数';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_DTL"."PACKING_SPEC" IS '包装规格';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_DTL"."LOADING_TYPE" IS '装柜方式';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_DTL"."STORAGE_OUT" IS '串货调整调出储位';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_DTL"."STORAGE_IN" IS '串货调整调入储位';
COMMENT ON TABLE "SPMS"."WHS_OTHER_DTL" IS '异常出入库明细表';

-- ----------------------------
-- Table structure for WHS_OTHER_TASK
-- ----------------------------
DROP TABLE "SPMS"."WHS_OTHER_TASK";
CREATE TABLE "SPMS"."WHS_OTHER_TASK" (
  "UUID" VARCHAR2(32 BYTE) VISIBLE NOT NULL,
  "SPMS_ID" VARCHAR2(32 BYTE) VISIBLE,
  "MOVEMENT_TYPE" VARCHAR2(32 BYTE) VISIBLE,
  "WERKS" VARCHAR2(6 BYTE) VISIBLE,
  "WHS_LOCATION_CODE" VARCHAR2(6 BYTE) VISIBLE,
  "SAP_VOUCHER_NUMBER" VARCHAR2(32 BYTE) VISIBLE,
  "SAP_VOUCHER_YEAR" VARCHAR2(8 BYTE) VISIBLE,
  "DOCUMENT_DATE" VARCHAR2(10 BYTE) VISIBLE,
  "POSTING_DATE" VARCHAR2(10 BYTE) VISIBLE,
  "CREATE_USERID" VARCHAR2(20 BYTE) VISIBLE,
  "SAP_PO" VARCHAR2(32 BYTE) VISIBLE,
  "SAP_ORDER_TYPE" VARCHAR2(32 BYTE) VISIBLE,
  "PURCHASE_GROUP" VARCHAR2(6 BYTE) VISIBLE,
  "PURCHASE_GROUP_NAME" VARCHAR2(64 BYTE) VISIBLE,
  "RELATED_VOUCHER_NUMBER" VARCHAR2(32 BYTE) VISIBLE,
  "RELATED_VOUCHER_YEAR" VARCHAR2(8 BYTE) VISIBLE,
  "RELATED_DOCUMENT_DATE" VARCHAR2(10 BYTE) VISIBLE,
  "RELATED_POSTING_DATE" VARCHAR2(10 BYTE) VISIBLE,
  "COST_CENTER" VARCHAR2(16 BYTE) VISIBLE,
  "PACKAGE_LIST" VARCHAR2(16 BYTE) VISIBLE,
  "GOODS_TYPE" VARCHAR2(30 BYTE) VISIBLE,
  "TASK_STATUS" VARCHAR2(4 BYTE) VISIBLE,
  "CREATE_DATE" VARCHAR2(10 BYTE) VISIBLE,
  "CREATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss'),
  "PACKAGE_NOTE" VARCHAR2(50 BYTE) VISIBLE,
  "DELIVERY_NOTE_SRM" VARCHAR2(35 BYTE) VISIBLE,
  "RELATED_TASK_ID" VARCHAR2(64 BYTE) VISIBLE,
  "UPDATE_TIME" DATE VISIBLE,
  "REMARKS" VARCHAR2(255 BYTE) VISIBLE,
  "DELIVERY_NOTE_SAP" VARCHAR2(32 BYTE) VISIBLE,
  "SAP_MOVEMENT_TYPE" VARCHAR2(16 BYTE) VISIBLE,
  "WERKS_MOVE_OUT" VARCHAR2(6 BYTE) VISIBLE,
  "WERKS_MOVE_IN" VARCHAR2(6 BYTE) VISIBLE,
  "WHS_LOCATION_CODE_MOVE_OUT" VARCHAR2(6 BYTE) VISIBLE,
  "WHS_LOCATION_CODE_MOVE_IN" VARCHAR2(6 BYTE) VISIBLE,
  "MOVE_OUT_REMARK" VARCHAR2(255 BYTE) VISIBLE,
  "MOVE_IN_REMARK" VARCHAR2(255 BYTE) VISIBLE,
  "DATE_OF_LOADING" VARCHAR2(10 BYTE) VISIBLE,
  "CABINET_NUMBER" VARCHAR2(16 BYTE) VISIBLE,
  "CABINET_SERIAL_NUMBER" VARCHAR2(2 BYTE) VISIBLE,
  "CABINET_CHECK_RESULT" VARCHAR2(128 BYTE) VISIBLE,
  "ACTUAL_LOADING_DATE" VARCHAR2(16 BYTE) VISIBLE,
  "MONITOR_LOADING" VARCHAR2(60 BYTE) VISIBLE,
  "LEAD_SEAL" VARCHAR2(32 BYTE) VISIBLE,
  "EMPTY_CABINET_WEIGHT" NUMBER(13,3) VISIBLE DEFAULT 0.000,
  "CANCEL_REMARK" VARCHAR2(255 BYTE) VISIBLE,
  "CANCEL_VOUCHER_NUMBER" VARCHAR2(32 BYTE) VISIBLE,
  "CANCEL_VOUCHER_YEAR" VARCHAR2(8 BYTE) VISIBLE,
  "CANCEL_DATE" VARCHAR2(12 BYTE) VISIBLE,
  "OPERATE_USER" VARCHAR2(255 BYTE) VISIBLE,
  "JUSTIFICATION" VARCHAR2(8 BYTE) VISIBLE
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."WHS_OTHER_TASK"."UUID" IS '异常出入库任务表主键UUID';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_TASK"."SPMS_ID" IS '异常出入库SPMS单号';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_TASK"."MOVEMENT_TYPE" IS '移动类型 卸货入库-311 赠品入库-511(对冲512) 串货调整-309(对冲310）报废-551(冲销552)
样品领用-Z09(冲销Z10) 仓库工具领用-Z21(冲销Z22) 其他公司领用-Z23(冲销Z24) 退货出库-161(冲销162) 委外加工发货出库-541(冲销542)';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_TASK"."WERKS" IS '工厂代码';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_TASK"."WHS_LOCATION_CODE" IS '仓库代码';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_TASK"."SAP_VOUCHER_NUMBER" IS 'SAP凭证号';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_TASK"."SAP_VOUCHER_YEAR" IS 'SAP凭证年份';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_TASK"."DOCUMENT_DATE" IS 'SAP凭证日期';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_TASK"."POSTING_DATE" IS '过帐日期';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_TASK"."CREATE_USERID" IS '操作员ID';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_TASK"."SAP_PO" IS 'SAP采购订单号';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_TASK"."SAP_ORDER_TYPE" IS 'SAP采购订单类型';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_TASK"."PURCHASE_GROUP" IS '采购组';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_TASK"."PURCHASE_GROUP_NAME" IS '采购组名称';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_TASK"."RELATED_VOUCHER_NUMBER" IS '关联凭证号';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_TASK"."RELATED_VOUCHER_YEAR" IS '关联凭证年度';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_TASK"."RELATED_DOCUMENT_DATE" IS '关联凭证日期';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_TASK"."RELATED_POSTING_DATE" IS '关联过帐日期';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_TASK"."COST_CENTER" IS '成本中心';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_TASK"."PACKAGE_LIST" IS '装箱单号';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_TASK"."GOODS_TYPE" IS '货物类型 X-备件 M-贸易';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_TASK"."TASK_STATUS" IS '单据状态 0-作废 1-草稿 2-操作中 3-待提交SAP 4-提交SAP成功 5-提交SAP失败 6-完成 7-已撤销';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_TASK"."CREATE_DATE" IS '创建日期';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_TASK"."CREATE_TIME" IS '创建时间，系统产生';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_TASK"."PACKAGE_NOTE" IS '包装单号';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_TASK"."DELIVERY_NOTE_SRM" IS 'SAP交货单号';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_TASK"."RELATED_TASK_ID" IS '关联单据号码';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_TASK"."UPDATE_TIME" IS '列新时间';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_TASK"."REMARKS" IS '备注';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_TASK"."DELIVERY_NOTE_SAP" IS 'SAP 内向交货单号';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_TASK"."SAP_MOVEMENT_TYPE" IS 'SAP移动类型';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_TASK"."WERKS_MOVE_OUT" IS '移出工厂代码';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_TASK"."WERKS_MOVE_IN" IS '移入工厂代码';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_TASK"."WHS_LOCATION_CODE_MOVE_OUT" IS '移出仓库代码';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_TASK"."WHS_LOCATION_CODE_MOVE_IN" IS '移入仓库代码';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_TASK"."MOVE_OUT_REMARK" IS '移出备注';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_TASK"."MOVE_IN_REMARK" IS '移入备注';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_TASK"."DATE_OF_LOADING" IS '可装柜日期';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_TASK"."CABINET_NUMBER" IS '柜号';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_TASK"."CABINET_SERIAL_NUMBER" IS '柜序号';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_TASK"."CABINET_CHECK_RESULT" IS '货柜检验结果';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_TASK"."ACTUAL_LOADING_DATE" IS '实际装柜日期';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_TASK"."MONITOR_LOADING" IS '监装人员';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_TASK"."LEAD_SEAL" IS '铅封号';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_TASK"."EMPTY_CABINET_WEIGHT" IS '空柜重量（KG）';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_TASK"."CANCEL_REMARK" IS '撤销备注信息';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_TASK"."CANCEL_VOUCHER_NUMBER" IS 'SAP撤销凭证号';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_TASK"."CANCEL_VOUCHER_YEAR" IS 'SAP撤销凭证年份';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_TASK"."CANCEL_DATE" IS 'SAP撤销日期(手输默认过账日期)';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_TASK"."OPERATE_USER" IS '操作员/现场搬运工计费';
COMMENT ON COLUMN "SPMS"."WHS_OTHER_TASK"."JUSTIFICATION" IS '移动原因当MSEG-BWART=511，需用户选择MSEG-GRUND字段值，值为0001来料破损、0002在库破损、0003其它问题、0004出货破损、1001来货报废
1002在库报废、1003其他报废';
COMMENT ON TABLE "SPMS"."WHS_OTHER_TASK" IS '异常出入库任务表';

-- ----------------------------
-- Table structure for WHS_OUT
-- ----------------------------
DROP TABLE "SPMS"."WHS_OUT";
CREATE TABLE "SPMS"."WHS_OUT" (
  "UUID" VARCHAR2(32 BYTE) VISIBLE NOT NULL,
  "WHS_OUT_NO" VARCHAR2(32 BYTE) VISIBLE,
  "WERKS" VARCHAR2(6 BYTE) VISIBLE,
  "WHS_LOCATION_CODE" VARCHAR2(6 BYTE) VISIBLE,
  "PACKAGE_LIST" VARCHAR2(10 BYTE) VISIBLE,
  "GOODS_TYPE" VARCHAR2(30 BYTE) VISIBLE,
  "DATE_OF_LOADING" VARCHAR2(10 BYTE) VISIBLE,
  "CABINET_NUMBER" VARCHAR2(16 BYTE) VISIBLE,
  "CABINET_SERIAL_NUMBER" VARCHAR2(2 BYTE) VISIBLE,
  "TASK_STATUS" VARCHAR2(2 BYTE) VISIBLE,
  "CREATE_USERID" VARCHAR2(20 BYTE) VISIBLE,
  "CREATE_DATE" VARCHAR2(10 BYTE) VISIBLE,
  "CREATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss'),
  "SAP_VOUCHER_NUMBER" VARCHAR2(16 BYTE) VISIBLE,
  "SAP_VOUCHER_YEAR" VARCHAR2(4 BYTE) VISIBLE,
  "ACTUAL_LOADING_DATE" VARCHAR2(16 BYTE) VISIBLE,
  "MONITOR_LOADING" VARCHAR2(60 BYTE) VISIBLE,
  "LOADING_TYPE" VARCHAR2(60 BYTE) VISIBLE,
  "REMARKS" VARCHAR2(255 BYTE) VISIBLE,
  "CABINET_CHECK_RESULT" VARCHAR2(128 BYTE) VISIBLE,
  "LEAD_SEAL" VARCHAR2(32 BYTE) VISIBLE,
  "EMPTY_CABINET_WEIGHT" NUMBER(13,3) VISIBLE DEFAULT 0.000,
  "OPERATE_USER" VARCHAR2(255 BYTE) VISIBLE
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."WHS_OUT"."UUID" IS '出库任务表主键UUID';
COMMENT ON COLUMN "SPMS"."WHS_OUT"."WHS_OUT_NO" IS '出库任务单号-工厂+仓库+日期+三位流水';
COMMENT ON COLUMN "SPMS"."WHS_OUT"."WERKS" IS '工厂代码';
COMMENT ON COLUMN "SPMS"."WHS_OUT"."WHS_LOCATION_CODE" IS '仓库地点代码/可装柜地点代码';
COMMENT ON COLUMN "SPMS"."WHS_OUT"."PACKAGE_LIST" IS '装箱单号';
COMMENT ON COLUMN "SPMS"."WHS_OUT"."GOODS_TYPE" IS '货物类型';
COMMENT ON COLUMN "SPMS"."WHS_OUT"."DATE_OF_LOADING" IS '可装柜日期';
COMMENT ON COLUMN "SPMS"."WHS_OUT"."CABINET_NUMBER" IS '柜号';
COMMENT ON COLUMN "SPMS"."WHS_OUT"."CABINET_SERIAL_NUMBER" IS '柜序号';
COMMENT ON COLUMN "SPMS"."WHS_OUT"."TASK_STATUS" IS '出库任务状态:0待处理，1处理中，2待提交SAP，3已关闭，4提交SAP成功，5提交SAP失败';
COMMENT ON COLUMN "SPMS"."WHS_OUT"."CREATE_USERID" IS '出库任务创建人工号';
COMMENT ON COLUMN "SPMS"."WHS_OUT"."CREATE_DATE" IS '创建日期';
COMMENT ON COLUMN "SPMS"."WHS_OUT"."CREATE_TIME" IS '创建时间';
COMMENT ON COLUMN "SPMS"."WHS_OUT"."SAP_VOUCHER_NUMBER" IS 'SAP物料凭证号';
COMMENT ON COLUMN "SPMS"."WHS_OUT"."SAP_VOUCHER_YEAR" IS 'SAP凭证年份';
COMMENT ON COLUMN "SPMS"."WHS_OUT"."ACTUAL_LOADING_DATE" IS '实际装柜日期';
COMMENT ON COLUMN "SPMS"."WHS_OUT"."MONITOR_LOADING" IS '监装人员';
COMMENT ON COLUMN "SPMS"."WHS_OUT"."LOADING_TYPE" IS '装柜方式（仅参考）';
COMMENT ON COLUMN "SPMS"."WHS_OUT"."REMARKS" IS '备注信息';
COMMENT ON COLUMN "SPMS"."WHS_OUT"."CABINET_CHECK_RESULT" IS '货柜检验结果';
COMMENT ON COLUMN "SPMS"."WHS_OUT"."LEAD_SEAL" IS '铅封号';
COMMENT ON COLUMN "SPMS"."WHS_OUT"."EMPTY_CABINET_WEIGHT" IS '空柜重量（KG）';
COMMENT ON COLUMN "SPMS"."WHS_OUT"."OPERATE_USER" IS '操作员/现场搬运工计费';
COMMENT ON TABLE "SPMS"."WHS_OUT" IS '出库任务表';

-- ----------------------------
-- Table structure for WHS_REPACKAGE_DTL
-- ----------------------------
DROP TABLE "SPMS"."WHS_REPACKAGE_DTL";
CREATE TABLE "SPMS"."WHS_REPACKAGE_DTL" (
  "MATERIAL_NO" VARCHAR2(18 BYTE) VISIBLE,
  "BOX_NOTE" VARCHAR2(50 BYTE) VISIBLE,
  "REPACKAGE_BILL_NO" VARCHAR2(16 BYTE) VISIBLE,
  "DOMESTIC_QTY_RECEIVED" NUMBER(13,0) VISIBLE,
  "STATUS" VARCHAR2(2 BYTE) VISIBLE,
  "UUID" VARCHAR2(32 BYTE) VISIBLE NOT NULL,
  "OPERATER_ID" VARCHAR2(60 BYTE) VISIBLE,
  "CREATE_TIME" DATE VISIBLE,
  "LEVEL" NUMBER(13,0) VISIBLE
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."WHS_REPACKAGE_DTL"."MATERIAL_NO" IS '物料号';
COMMENT ON COLUMN "SPMS"."WHS_REPACKAGE_DTL"."BOX_NOTE" IS '箱码';
COMMENT ON COLUMN "SPMS"."WHS_REPACKAGE_DTL"."REPACKAGE_BILL_NO" IS '拆箱单号';
COMMENT ON COLUMN "SPMS"."WHS_REPACKAGE_DTL"."DOMESTIC_QTY_RECEIVED" IS '实际数量';
COMMENT ON COLUMN "SPMS"."WHS_REPACKAGE_DTL"."STATUS" IS '是否SAP同步成功（0=不成功，1=成功）';
COMMENT ON COLUMN "SPMS"."WHS_REPACKAGE_DTL"."UUID" IS 'UUID';
COMMENT ON COLUMN "SPMS"."WHS_REPACKAGE_DTL"."OPERATER_ID" IS '员工工号';
COMMENT ON COLUMN "SPMS"."WHS_REPACKAGE_DTL"."CREATE_TIME" IS '时间';
COMMENT ON COLUMN "SPMS"."WHS_REPACKAGE_DTL"."LEVEL" IS '层级';

-- ----------------------------
-- Table structure for WHS_REPACKAGE_NOTE
-- ----------------------------
DROP TABLE "SPMS"."WHS_REPACKAGE_NOTE";
CREATE TABLE "SPMS"."WHS_REPACKAGE_NOTE" (
  "REPACKAGE_BILL_NO" VARCHAR2(32 BYTE) VISIBLE NOT NULL,
  "OPERATE_TIME" DATE VISIBLE,
  "WORK_ID" VARCHAR2(60 BYTE) VISIBLE,
  "STATUS" VARCHAR2(10 BYTE) VISIBLE
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;

-- ----------------------------
-- Table structure for WHS_STORAGE
-- ----------------------------
DROP TABLE "SPMS"."WHS_STORAGE";
CREATE TABLE "SPMS"."WHS_STORAGE" (
  "UUID" VARCHAR2(32 BYTE) VISIBLE NOT NULL,
  "WERKS" VARCHAR2(6 BYTE) VISIBLE,
  "WHS_LOCATION_CODE" VARCHAR2(6 BYTE) VISIBLE,
  "STORAGE_AREA" VARCHAR2(32 BYTE) VISIBLE,
  "SHELF_NO" VARCHAR2(32 BYTE) VISIBLE,
  "SHELF_LAYER" VARCHAR2(32 BYTE) VISIBLE,
  "SHELF_CELL" VARCHAR2(32 BYTE) VISIBLE,
  "STORAGE_NO" VARCHAR2(32 BYTE) VISIBLE,
  "STORAGE_TYPE" VARCHAR2(2 BYTE) VISIBLE,
  "STORAGE_INFO" VARCHAR2(255 BYTE) VISIBLE,
  "STORAGE_STATUS" VARCHAR2(2 BYTE) VISIBLE DEFAULT 1,
  "REMARKS" VARCHAR2(255 BYTE) VISIBLE,
  "CREATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss')
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."WHS_STORAGE"."UUID" IS '储位UUID';
COMMENT ON COLUMN "SPMS"."WHS_STORAGE"."WERKS" IS '工厂代码';
COMMENT ON COLUMN "SPMS"."WHS_STORAGE"."WHS_LOCATION_CODE" IS '仓库地点代码';
COMMENT ON COLUMN "SPMS"."WHS_STORAGE"."STORAGE_AREA" IS '库区';
COMMENT ON COLUMN "SPMS"."WHS_STORAGE"."SHELF_NO" IS '货架架子编号';
COMMENT ON COLUMN "SPMS"."WHS_STORAGE"."SHELF_LAYER" IS '货架架子层数编号';
COMMENT ON COLUMN "SPMS"."WHS_STORAGE"."SHELF_CELL" IS '货架层上格子编号';
COMMENT ON COLUMN "SPMS"."WHS_STORAGE"."STORAGE_NO" IS '储位编号（架号+层号+格子号）';
COMMENT ON COLUMN "SPMS"."WHS_STORAGE"."STORAGE_TYPE" IS '储位类型';
COMMENT ON COLUMN "SPMS"."WHS_STORAGE"."STORAGE_INFO" IS '储位信息说明';
COMMENT ON COLUMN "SPMS"."WHS_STORAGE"."STORAGE_STATUS" IS '储位状态（默认1启用，0停用）';
COMMENT ON COLUMN "SPMS"."WHS_STORAGE"."REMARKS" IS '备注说明';
COMMENT ON TABLE "SPMS"."WHS_STORAGE" IS '仓库储位信息表';

-- ----------------------------
-- Table structure for WHS_STORAGE_INVENTORY
-- ----------------------------
DROP TABLE "SPMS"."WHS_STORAGE_INVENTORY";
CREATE TABLE "SPMS"."WHS_STORAGE_INVENTORY" (
  "UUID" VARCHAR2(32 BYTE) VISIBLE,
  "MATERIAL_NO" VARCHAR2(32 BYTE) VISIBLE,
  "BOX_NOTE" VARCHAR2(50 BYTE) VISIBLE,
  "QUANTITY" NUMBER(13,3) VISIBLE,
  "AVAILABLE_QTY" NUMBER(13,3) VISIBLE,
  "CREATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss'),
  "UPDATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss'),
  "BASIC_UNIT" VARCHAR2(32 BYTE) VISIBLE,
  "OPERATE_TIME" VARCHAR2(32 BYTE) VISIBLE
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."WHS_STORAGE_INVENTORY"."UUID" IS '储位UUID';
COMMENT ON COLUMN "SPMS"."WHS_STORAGE_INVENTORY"."MATERIAL_NO" IS '物料编码';
COMMENT ON COLUMN "SPMS"."WHS_STORAGE_INVENTORY"."BOX_NOTE" IS '箱码-仅用于自管仓备件货按箱处理使用';
COMMENT ON COLUMN "SPMS"."WHS_STORAGE_INVENTORY"."QUANTITY" IS '储位该物料总数量';
COMMENT ON COLUMN "SPMS"."WHS_STORAGE_INVENTORY"."AVAILABLE_QTY" IS '储位该物料可用总数量';
COMMENT ON COLUMN "SPMS"."WHS_STORAGE_INVENTORY"."CREATE_TIME" IS '创建时间';
COMMENT ON COLUMN "SPMS"."WHS_STORAGE_INVENTORY"."UPDATE_TIME" IS '更新时间';
COMMENT ON COLUMN "SPMS"."WHS_STORAGE_INVENTORY"."BASIC_UNIT" IS '基本单位';
COMMENT ON COLUMN "SPMS"."WHS_STORAGE_INVENTORY"."OPERATE_TIME" IS '操作时间';
COMMENT ON TABLE "SPMS"."WHS_STORAGE_INVENTORY" IS '储位库存信息表';

-- ----------------------------
-- Table structure for WITHDRAW_TASK
-- ----------------------------
DROP TABLE "SPMS"."WITHDRAW_TASK";
CREATE TABLE "SPMS"."WITHDRAW_TASK" (
  "UUID" VARCHAR2(32 BYTE) VISIBLE NOT NULL,
  "TASK_ID" VARCHAR2(32 BYTE) VISIBLE,
  "WERKS" VARCHAR2(6 BYTE) VISIBLE,
  "WHS_LOCATION_CODE" VARCHAR2(6 BYTE) VISIBLE,
  "CREATE_USERID" VARCHAR2(64 BYTE) VISIBLE,
  "CREATE_DATE" VARCHAR2(16 BYTE) VISIBLE,
  "TASK_STATUS" VARCHAR2(2 BYTE) VISIBLE,
  "CREATE_TIME" DATE VISIBLE DEFAULT TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss'),
  "DELIVERY_NOTE_SAP" VARCHAR2(10 BYTE) VISIBLE,
  "PDA_SN" VARCHAR2(32 BYTE) VISIBLE,
  "MOBILE_TYPE" VARCHAR2(8 BYTE) VISIBLE,
  "TASK_CATEGORY" VARCHAR2(2 BYTE) VISIBLE,
  "RELATED_TASK_ID" VARCHAR2(32 BYTE) VISIBLE,
  "SAP_VOUCHER_NUMBER" VARCHAR2(32 BYTE) VISIBLE,
  "SAP_VOUCHER_YEAR" VARCHAR2(4 BYTE) VISIBLE
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."WITHDRAW_TASK"."UUID" IS '冲销任务UUID';
COMMENT ON COLUMN "SPMS"."WITHDRAW_TASK"."TASK_ID" IS '冲销任务单号';
COMMENT ON COLUMN "SPMS"."WITHDRAW_TASK"."WERKS" IS '工厂编号';
COMMENT ON COLUMN "SPMS"."WITHDRAW_TASK"."WHS_LOCATION_CODE" IS '仓库地点代码';
COMMENT ON COLUMN "SPMS"."WITHDRAW_TASK"."CREATE_USERID" IS '创建人工号';
COMMENT ON COLUMN "SPMS"."WITHDRAW_TASK"."CREATE_DATE" IS '创建日期';
COMMENT ON COLUMN "SPMS"."WITHDRAW_TASK"."TASK_STATUS" IS '任务状态：1 已完成';
COMMENT ON COLUMN "SPMS"."WITHDRAW_TASK"."CREATE_TIME" IS '创建时间';
COMMENT ON COLUMN "SPMS"."WITHDRAW_TASK"."DELIVERY_NOTE_SAP" IS '交货单号';
COMMENT ON COLUMN "SPMS"."WITHDRAW_TASK"."PDA_SN" IS 'PDA设备编号';
COMMENT ON COLUMN "SPMS"."WITHDRAW_TASK"."MOBILE_TYPE" IS '101采购入库；102出库冲销；';
COMMENT ON COLUMN "SPMS"."WITHDRAW_TASK"."TASK_CATEGORY" IS '任备类别 X 备件货，M 贸易货';
COMMENT ON COLUMN "SPMS"."WITHDRAW_TASK"."RELATED_TASK_ID" IS '关联单号';
COMMENT ON COLUMN "SPMS"."WITHDRAW_TASK"."SAP_VOUCHER_NUMBER" IS 'SAP 凭证号';
COMMENT ON COLUMN "SPMS"."WITHDRAW_TASK"."SAP_VOUCHER_YEAR" IS 'SAP 凭证年度';
COMMENT ON TABLE "SPMS"."WITHDRAW_TASK" IS '移动冲销表';

-- ----------------------------
-- Table structure for WITHDRAW_TASK_DTL
-- ----------------------------
DROP TABLE "SPMS"."WITHDRAW_TASK_DTL";
CREATE TABLE "SPMS"."WITHDRAW_TASK_DTL" (
  "UUID" VARCHAR2(32 BYTE) VISIBLE,
  "TASK_ROW_ID" VARCHAR2(6 BYTE) VISIBLE,
  "MATERIAL_NO" VARCHAR2(32 BYTE) VISIBLE,
  "BOX_NOTE" VARCHAR2(50 BYTE) VISIBLE,
  "QUANTITY" NUMBER VISIBLE,
  "STORAGE" VARCHAR2(32 BYTE) VISIBLE,
  "DELIVERY_NOTE_SAP" VARCHAR2(10 BYTE) VISIBLE
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."WITHDRAW_TASK_DTL"."UUID" IS '冲销任务UUID';
COMMENT ON COLUMN "SPMS"."WITHDRAW_TASK_DTL"."TASK_ROW_ID" IS '冲销任务行号';
COMMENT ON COLUMN "SPMS"."WITHDRAW_TASK_DTL"."MATERIAL_NO" IS '物料编号';
COMMENT ON COLUMN "SPMS"."WITHDRAW_TASK_DTL"."BOX_NOTE" IS '箱码-仅用于自管仓备件管理';
COMMENT ON COLUMN "SPMS"."WITHDRAW_TASK_DTL"."QUANTITY" IS '数量';
COMMENT ON COLUMN "SPMS"."WITHDRAW_TASK_DTL"."STORAGE" IS '储位UUID';
COMMENT ON COLUMN "SPMS"."WITHDRAW_TASK_DTL"."DELIVERY_NOTE_SAP" IS 'SAP交货单号';
COMMENT ON TABLE "SPMS"."WITHDRAW_TASK_DTL" IS '冲销任务表明细';

-- ----------------------------
-- Table structure for WORKSHOP
-- ----------------------------
DROP TABLE "SPMS"."WORKSHOP";
CREATE TABLE "SPMS"."WORKSHOP" (
  "WERKS" VARCHAR2(6 BYTE) VISIBLE,
  "WORKSHOP_CODE" VARCHAR2(16 BYTE) VISIBLE,
  "WORKSHOP_NAME_ZH" VARCHAR2(128 BYTE) VISIBLE,
  "WORKSHOP_NAME_EN" VARCHAR2(128 BYTE) VISIBLE,
  "WORKSHOP_DESC" VARCHAR2(255 BYTE) VISIBLE
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SPMS"."WORKSHOP"."WERKS" IS '工厂代码';
COMMENT ON COLUMN "SPMS"."WORKSHOP"."WORKSHOP_CODE" IS '车间代码';
COMMENT ON COLUMN "SPMS"."WORKSHOP"."WORKSHOP_NAME_ZH" IS '车间中文名称';
COMMENT ON COLUMN "SPMS"."WORKSHOP"."WORKSHOP_NAME_EN" IS '车间英文名称';
COMMENT ON COLUMN "SPMS"."WORKSHOP"."WORKSHOP_DESC" IS '车间描述';
COMMENT ON TABLE "SPMS"."WORKSHOP" IS '车间信息表';

-- ----------------------------
-- Primary Key structure for table COST_CENTER
-- ----------------------------
ALTER TABLE "SPMS"."COST_CENTER" ADD CONSTRAINT "COST_CENTER_PK" PRIMARY KEY ("COST_CENTER_CODE");

-- ----------------------------
-- Checks structure for table COST_CENTER
-- ----------------------------
ALTER TABLE "SPMS"."COST_CENTER" ADD CONSTRAINT "SYS_C0013755" CHECK ("COST_CENTER_CODE" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "SPMS"."COST_CENTER" ADD CONSTRAINT "SYS_C0024643" CHECK ("COST_CENTER_CODE" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Triggers structure for table COST_CENTER
-- ----------------------------
CREATE TRIGGER "SPMS"."TR_COST_CENTER_BEF" BEFORE INSERT ON "SPMS"."COST_CENTER" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW 
DECLARE
    NUM NUMBER := 0;
BEGIN
    SELECT COUNT(*) INTO NUM FROM COST_CENTER CC
    WHERE CC.COST_CENTER_CODE = :NEW.COST_CENTER_CODE;
    if NUM = 1 THEN
        DELETE FROM COST_CENTER CC1
        WHERE CC1.COST_CENTER_CODE = :NEW.COST_CENTER_CODE;
    end if;
end;
/

-- ----------------------------
-- Primary Key structure for table INVENTORY_CHECK
-- ----------------------------
ALTER TABLE "SPMS"."INVENTORY_CHECK" ADD CONSTRAINT "INVENTORY_CHECK_PK" PRIMARY KEY ("UUID");

-- ----------------------------
-- Checks structure for table INVENTORY_CHECK
-- ----------------------------
ALTER TABLE "SPMS"."INVENTORY_CHECK" ADD CONSTRAINT "SYS_C0021668" CHECK ("UUID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Triggers structure for table INVENTORY_CHECK
-- ----------------------------
CREATE TRIGGER "SPMS"."TR_INVENTORY_CHECK_BEF" BEFORE UPDATE ON "SPMS"."INVENTORY_CHECK" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW 
BEGIN
    :new.UPDATE_TIME := TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss');
END;
/
CREATE TRIGGER "SPMS"."TR_INVENTORY_CHECK_BEF1" BEFORE INSERT ON "SPMS"."INVENTORY_CHECK" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW 
DECLARE
    V_NUM1 NUMBER := 0;
BEGIN
    SELECT NVL(TO_NUMBER(SUBSTR(MAX(SOT.INVENTORY_CHECK_ID), -3, 3)), 0) INTO V_NUM1 FROM INVENTORY_CHECK SOT
    WHERE SOT.CREATE_DATE = :NEW.CREATE_DATE
      AND SOT.WERKS = :NEW.WERKS
      AND SOT.WHS_LOCATION_CODE = :NEW.WHS_LOCATION_CODE;
    :NEW.INVENTORY_CHECK_ID := :NEW.WERKS||'-'||:NEW.WHS_LOCATION_CODE||'-'||REPLACE(:NEW.CREATE_DATE, '-')||'-'||SUBSTR(1001 + V_NUM1, 2, 4);
END;
/

-- ----------------------------
-- Primary Key structure for table INVENTORY_CHECK_ACTION
-- ----------------------------
ALTER TABLE "SPMS"."INVENTORY_CHECK_ACTION" ADD CONSTRAINT "INVENTORY_CHECK_ACTION_PK" PRIMARY KEY ("UUID");

-- ----------------------------
-- Checks structure for table INVENTORY_CHECK_ACTION
-- ----------------------------
ALTER TABLE "SPMS"."INVENTORY_CHECK_ACTION" ADD CONSTRAINT "SYS_C0021670" CHECK ("UUID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Triggers structure for table INVENTORY_CHECK_ACTION
-- ----------------------------
CREATE TRIGGER "SPMS"."TR_INVENTORY_CHECK_ACTION_BEF" BEFORE UPDATE ON "SPMS"."INVENTORY_CHECK_ACTION" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW 
BEGIN
    :new.UPDATE_TIME := TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss');
END;
/
CREATE TRIGGER "SPMS"."TR_INVENTORY_CHECK_ACTION_ID" BEFORE INSERT ON "SPMS"."INVENTORY_CHECK_ACTION" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW 
DECLARE
    V_NUM1 NUMBER := 0;
BEGIN
    SELECT NVL(TO_NUMBER(SUBSTR(MAX(SOT.SPMS_ID), -3, 3)), 0) INTO V_NUM1 FROM INVENTORY_CHECK_ACTION SOT
    WHERE SOT.CREATE_DATE = :NEW.CREATE_DATE
      AND SOT.WERKS = :NEW.WERKS
      AND SOT.WHS_LOCATION_CODE = :NEW.WHS_LOCATION_CODE;
    :NEW.SPMS_ID := :NEW.WERKS||'-'||:NEW.WHS_LOCATION_CODE||'-'||REPLACE(:NEW.CREATE_DATE, '-')||'-'||SUBSTR(1001 + V_NUM1, 2, 4);
END;
/

-- ----------------------------
-- Primary Key structure for table MATERIAL_APPLICATION
-- ----------------------------
ALTER TABLE "SPMS"."MATERIAL_APPLICATION" ADD CONSTRAINT "SYS_C0019229" PRIMARY KEY ("APPLICATION_UUID");

-- ----------------------------
-- Checks structure for table MATERIAL_APPLICATION
-- ----------------------------
ALTER TABLE "SPMS"."MATERIAL_APPLICATION" ADD CONSTRAINT "SYS_C0019228" CHECK ("APPLICATION_UUID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Triggers structure for table MATERIAL_APPLICATION
-- ----------------------------
CREATE TRIGGER "SPMS"."TR_MATERIAL_APPLICATION_BEF" BEFORE INSERT ON "SPMS"."MATERIAL_APPLICATION" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW 
DECLARE
    V_NUM1 NUMBER := 0;
BEGIN
    SELECT NVL(TO_NUMBER(SUBSTR(MAX(MA.APPLICATION_ID), -5, 5)), 0) INTO V_NUM1 FROM MATERIAL_APPLICATION MA
    WHERE MA.WERKS = :NEW.WERKS AND MA.WORKSHOP_CODE = :NEW.WORKSHOP_CODE;
    :NEW.APPLICATION_ID := :NEW.WERKS||'-'||:NEW.WORKSHOP_CODE||'-'||SUBSTR(100001 + V_NUM1, 2, 6);
END;
/
CREATE TRIGGER "SPMS"."TR_MATERIAL_APPLICATION_BEF1" BEFORE UPDATE ON "SPMS"."MATERIAL_APPLICATION" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW 
BEGIN
    :NEW.UPDATE_TIME := TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss');
END;
/

-- ----------------------------
-- Primary Key structure for table MATERIAL_APPLICATION_DTL
-- ----------------------------
ALTER TABLE "SPMS"."MATERIAL_APPLICATION_DTL" ADD CONSTRAINT "MATERIAL_APPLICATION_DTL_PK" PRIMARY KEY ("AUTO_ID");

-- ----------------------------
-- Checks structure for table MATERIAL_APPLICATION_DTL
-- ----------------------------
ALTER TABLE "SPMS"."MATERIAL_APPLICATION_DTL" ADD CONSTRAINT "SYS_C0019230" CHECK ("AUTO_ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Triggers structure for table MATERIAL_APPLICATION_DTL
-- ----------------------------
CREATE TRIGGER "SPMS"."TR_MATERIAL_APPLICATION_DTL_BEF" BEFORE INSERT ON "SPMS"."MATERIAL_APPLICATION_DTL" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW 
DECLARE
    V_NUM1 NUMBER := 0;
BEGIN
    SELECT NVL(TO_NUMBER(MAX(MAD.AUTO_ID)), 0) INTO V_NUM1 FROM MATERIAL_APPLICATION_DTL MAD;
    :NEW.AUTO_ID := V_NUM1 + 1;
END;
/

-- ----------------------------
-- Primary Key structure for table MATERIAL_CATEGORY
-- ----------------------------
ALTER TABLE "SPMS"."MATERIAL_CATEGORY" ADD CONSTRAINT "SYS_C0015240" PRIMARY KEY ("CATEGORY_ID");

-- ----------------------------
-- Checks structure for table MATERIAL_CATEGORY
-- ----------------------------
ALTER TABLE "SPMS"."MATERIAL_CATEGORY" ADD CONSTRAINT "SYS_C0015234" CHECK ("CATEGORY_ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "SPMS"."MATERIAL_CATEGORY" ADD CONSTRAINT "SYS_C0015235" CHECK ("CATEGORY_LEVEL" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "SPMS"."MATERIAL_CATEGORY" ADD CONSTRAINT "SYS_C0015236" CHECK ("PARENT_ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "SPMS"."MATERIAL_CATEGORY" ADD CONSTRAINT "SYS_C0015237" CHECK ("CATEGORY_NAME" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "SPMS"."MATERIAL_CATEGORY" ADD CONSTRAINT "SYS_C0015238" CHECK ("CATEGORY_RANK" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "SPMS"."MATERIAL_CATEGORY" ADD CONSTRAINT "SYS_C0015239" CHECK ("IS_DELETED" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Triggers structure for table MATERIAL_CATEGORY
-- ----------------------------
CREATE TRIGGER "SPMS"."TR_MATERIAL_CATEGORY_BEF" BEFORE UPDATE ON "SPMS"."MATERIAL_CATEGORY" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW 
BEGIN
    :new.UPDATE_TIME :=
            TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss');
END;
/

-- ----------------------------
-- Primary Key structure for table MATERIAL_PHOTOS
-- ----------------------------
ALTER TABLE "SPMS"."MATERIAL_PHOTOS" ADD CONSTRAINT "MATERIAL_PHOTOS_PK" PRIMARY KEY ("MATERIAL_NO");

-- ----------------------------
-- Checks structure for table MATERIAL_PHOTOS
-- ----------------------------
ALTER TABLE "SPMS"."MATERIAL_PHOTOS" ADD CONSTRAINT "SYS_C0013783" CHECK ("MATERIAL_NO" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "SPMS"."MATERIAL_PHOTOS" ADD CONSTRAINT "SYS_C0013784" CHECK ("PHOTOS" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "SPMS"."MATERIAL_PHOTOS" ADD CONSTRAINT "SYS_C0024661" CHECK ("MATERIAL_NO" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "SPMS"."MATERIAL_PHOTOS" ADD CONSTRAINT "SYS_C0024662" CHECK ("PHOTOS" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Primary Key structure for table MATERIAL_SAP
-- ----------------------------
ALTER TABLE "SPMS"."MATERIAL_SAP" ADD CONSTRAINT "SYS_C0017775" PRIMARY KEY ("MATERIAL_NO");

-- ----------------------------
-- Checks structure for table MATERIAL_SAP
-- ----------------------------
ALTER TABLE "SPMS"."MATERIAL_SAP" ADD CONSTRAINT "SYS_C0017774" CHECK ("MATERIAL_NO" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Indexes structure for table MATERIAL_SAP
-- ----------------------------
CREATE INDEX "SPMS"."INDEX_MATERIAL_SAP_EN_DESC"
  ON "SPMS"."MATERIAL_SAP" ("MATERIAL_EN_DESC" ASC)
  LOGGING
  VISIBLE
PCTFREE 10
INITRANS 2
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
  FLASH_CACHE DEFAULT
)
   USABLE;
CREATE INDEX "SPMS"."INDEX_MATERIAL_SAP_ZH_DESC"
  ON "SPMS"."MATERIAL_SAP" ("MATERIAL_ZH_DESC" ASC)
  LOGGING
  VISIBLE
PCTFREE 10
INITRANS 2
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
  FLASH_CACHE DEFAULT
)
   USABLE;
CREATE INDEX "SPMS"."INDEX_SPMS_MARK"
  ON "SPMS"."MATERIAL_SAP" ("SPMS_MARK" ASC)
  LOGGING
  VISIBLE
PCTFREE 10
INITRANS 2
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
  FLASH_CACHE DEFAULT
)
   USABLE;

-- ----------------------------
-- Triggers structure for table MATERIAL_SAP
-- ----------------------------
CREATE TRIGGER "SPMS"."TR_MATERIAL_SAP" BEFORE INSERT ON "SPMS"."MATERIAL_SAP" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW 
DECLARE
    NUM NUMBER := 0;
BEGIN
    SELECT COUNT(*) INTO NUM FROM MATERIAL_SAP MS WHERE MS.MATERIAL_NO = :NEW.MATERIAL_NO;
    :NEW.SPMS_CREATE_TIME := TO_DATE(TO_CHAR(SYSDATE, 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss');
    if NUM = 1 THEN
        DELETE FROM MATERIAL_SAP M WHERE M.MATERIAL_NO = :NEW.MATERIAL_NO;
    end if;
end;
/

-- ----------------------------
-- Triggers structure for table MATERIAL_SAP_WERKS_RELATION
-- ----------------------------
CREATE TRIGGER "SPMS"."TR_MATERIAL_SAP_WERKS_RELATION" BEFORE INSERT ON "SPMS"."MATERIAL_SAP_WERKS_RELATION" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW 
DECLARE
    NUM NUMBER := 0;
BEGIN
    SELECT COUNT(*) INTO NUM FROM MATERIAL_SAP_WERKS_RELATION MS
    WHERE MS.MATERIAL_NO = :NEW.MATERIAL_NO AND MS.WERKS = :NEW.WERKS;
    if NUM = 1 THEN
        DELETE FROM MATERIAL_SAP_WERKS_RELATION M
        WHERE M.MATERIAL_NO = :NEW.MATERIAL_NO AND M.WERKS = :NEW.WERKS ;
    end if;
end;
/

-- ----------------------------
-- Primary Key structure for table MATERIAL_SPMS
-- ----------------------------
ALTER TABLE "SPMS"."MATERIAL_SPMS" ADD CONSTRAINT "SYS_C0025874" PRIMARY KEY ("UUID");

-- ----------------------------
-- Checks structure for table MATERIAL_SPMS
-- ----------------------------
ALTER TABLE "SPMS"."MATERIAL_SPMS" ADD CONSTRAINT "SYS_C0013787" CHECK ("UUID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "SPMS"."MATERIAL_SPMS" ADD CONSTRAINT "SYS_C0025872" CHECK ("UUID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Indexes structure for table MATERIAL_SPMS
-- ----------------------------
CREATE INDEX "SPMS"."INDEX_MATERIAL_SPMS_CATEGORY_ID"
  ON "SPMS"."MATERIAL_SPMS" ("CATEGORY_ID" ASC) LOCAL
  LOGGING
  ONLINE
  NOSORT
  VISIBLE
PCTFREE 10
INITRANS 2
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
  FLASH_CACHE DEFAULT
)
   USABLE;

-- ----------------------------
-- Primary Key structure for table MATERIAL_SRM_LONG_CONTRACT
-- ----------------------------
ALTER TABLE "SPMS"."MATERIAL_SRM_LONG_CONTRACT" ADD CONSTRAINT "MATERIAL_SRM_LONG_CONTRACT_LONG_CONTRACT_CODE_PK" PRIMARY KEY ("LONG_CONTRACT_CODE");

-- ----------------------------
-- Checks structure for table MATERIAL_SRM_LONG_CONTRACT
-- ----------------------------
ALTER TABLE "SPMS"."MATERIAL_SRM_LONG_CONTRACT" ADD CONSTRAINT "SYS_C0010793" CHECK ("MATERIAL_NO" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "SPMS"."MATERIAL_SRM_LONG_CONTRACT" ADD CONSTRAINT "SYS_C0013790" CHECK ("MATERIAL_NO" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "SPMS"."MATERIAL_SRM_LONG_CONTRACT" ADD CONSTRAINT "SYS_C0013791" CHECK ("LONG_CONTRACT_CODE" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Primary Key structure for table MOVEMENT_TYPE
-- ----------------------------
ALTER TABLE "SPMS"."MOVEMENT_TYPE" ADD CONSTRAINT "MOVEMENT_TYPE_PK" PRIMARY KEY ("UUID");

-- ----------------------------
-- Checks structure for table MOVEMENT_TYPE
-- ----------------------------
ALTER TABLE "SPMS"."MOVEMENT_TYPE" ADD CONSTRAINT "SYS_C0062271" CHECK ("UUID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Triggers structure for table MOVEMENT_TYPE
-- ----------------------------
CREATE TRIGGER "SPMS"."TR_MOVEMENT_TYPE_BEF_UPDATE" BEFORE UPDATE ON "SPMS"."MOVEMENT_TYPE" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW 
BEGIN
    :new.UPDATE_TIME := TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss');
END;
/

-- ----------------------------
-- Primary Key structure for table ORDER_COST_DEPT
-- ----------------------------
ALTER TABLE "SPMS"."ORDER_COST_DEPT" ADD CONSTRAINT "ORDER_COST_DEPT_PK" PRIMARY KEY ("UUID");

-- ----------------------------
-- Checks structure for table ORDER_COST_DEPT
-- ----------------------------
ALTER TABLE "SPMS"."ORDER_COST_DEPT" ADD CONSTRAINT "SYS_C0015249" CHECK ("UUID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Primary Key structure for table ORDER_KEY_VALUE_CONFIG
-- ----------------------------
ALTER TABLE "SPMS"."ORDER_KEY_VALUE_CONFIG" ADD CONSTRAINT "ORDER_KEY_VALUE_CONFIG_PK" PRIMARY KEY ("UUID");

-- ----------------------------
-- Checks structure for table ORDER_KEY_VALUE_CONFIG
-- ----------------------------
ALTER TABLE "SPMS"."ORDER_KEY_VALUE_CONFIG" ADD CONSTRAINT "SYS_C0013792" CHECK ("UUID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "SPMS"."ORDER_KEY_VALUE_CONFIG" ADD CONSTRAINT "SYS_C0019557" CHECK ("UUID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Indexes structure for table ORDER_LOG
-- ----------------------------
CREATE INDEX "SPMS"."INDEX_LOG_AUTO_ID"
  ON "SPMS"."ORDER_LOG" ("LOG_AUTO_ID" ASC) LOCAL
  LOGGING
  ONLINE
  NOSORT
  VISIBLE
PCTFREE 10
INITRANS 2
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
  FLASH_CACHE DEFAULT
)
   USABLE;

-- ----------------------------
-- Triggers structure for table ORDER_LOG
-- ----------------------------
CREATE TRIGGER "SPMS"."TR_ORDER_LOG_BEF" BEFORE INSERT ON "SPMS"."ORDER_LOG" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW 
DECLARE
    V_NUM1 NUMBER := 0;
BEGIN
    SELECT NVL(TO_NUMBER(MAX(LOG.LOG_AUTO_ID)), 0) INTO V_NUM1 FROM ORDER_LOG LOG;
    :NEW.LOG_AUTO_ID := V_NUM1 + 1;
END;
/

-- ----------------------------
-- Primary Key structure for table ORDER_WERKS
-- ----------------------------
ALTER TABLE "SPMS"."ORDER_WERKS" ADD CONSTRAINT "SYS_C0010887" PRIMARY KEY ("SPMS_ID");

-- ----------------------------
-- Checks structure for table ORDER_WERKS
-- ----------------------------
ALTER TABLE "SPMS"."ORDER_WERKS" ADD CONSTRAINT "SYS_C0010886" CHECK ("SPMS_ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "SPMS"."ORDER_WERKS" ADD CONSTRAINT "SYS_C0013793" CHECK ("SPMS_ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Triggers structure for table ORDER_WERKS
-- ----------------------------
CREATE TRIGGER "SPMS"."TR_ORDER_WERKS_BEF" BEFORE INSERT ON "SPMS"."ORDER_WERKS" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW 
DECLARE
    V_NUM1 NUMBER := 0;
  BEGIN
    SELECT NVL(TO_NUMBER(SUBSTR(MAX(OW.SPMS_ID), 11, 13)), 0) INTO V_NUM1 FROM ORDER_WERKS OW
    WHERE SUBSTR(OW.APPLICATION_DATE, 0, 4) = SUBSTR(:NEW.APPLICATION_DATE, 0, 4)
          AND OW.WERKS = :NEW.WERKS;
    :NEW.SPMS_ID := :NEW.WERKS||'-'||SUBSTR(:NEW.APPLICATION_DATE, 0, 4)|| '-'|| SUBSTR(1001 + V_NUM1, 2, 4);
  END;
/

-- ----------------------------
-- Triggers structure for table ORDER_WERKS_DTL
-- ----------------------------
CREATE TRIGGER "SPMS"."TR_ORDER_WERKS_DTL_BEF" BEFORE INSERT ON "SPMS"."ORDER_WERKS_DTL" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW 
DECLARE
    WS_ID VARCHAR2(64) := 0;
  BEGIN
    SELECT OW.SPMS_ID INTO WS_ID FROM ORDER_WERKS OW WHERE OW.UUID = :NEW.UUID;
    :NEW.SPMS_ID := WS_ID;
  END;
/

-- ----------------------------
-- Primary Key structure for table ORDER_WORKSHOP
-- ----------------------------
ALTER TABLE "SPMS"."ORDER_WORKSHOP" ADD CONSTRAINT "SYS_C0013224" PRIMARY KEY ("SPMS_WS_ID");

-- ----------------------------
-- Checks structure for table ORDER_WORKSHOP
-- ----------------------------
ALTER TABLE "SPMS"."ORDER_WORKSHOP" ADD CONSTRAINT "SYS_C0013223" CHECK ("SPMS_WS_ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "SPMS"."ORDER_WORKSHOP" ADD CONSTRAINT "SYS_C0013794" CHECK ("SPMS_WS_ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Triggers structure for table ORDER_WORKSHOP
-- ----------------------------
CREATE TRIGGER "SPMS"."TR_ORDER_WORKSHOP_BEF" BEFORE UPDATE ON "SPMS"."ORDER_WORKSHOP" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW 
BEGIN
:new.UPDATE_TIME := TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss');
END;
/
CREATE TRIGGER "SPMS"."TR_ORDER_WORKSHOP_BEF1" BEFORE INSERT ON "SPMS"."ORDER_WORKSHOP" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW 
DECLARE
    V_NUM1 NUMBER := 0;
  BEGIN
    SELECT NVL(TO_NUMBER(SUBSTR(MAX(OW.SPMS_WS_ID), -3, 3)), 0) INTO V_NUM1 FROM ORDER_WORKSHOP OW
    WHERE OW.CREATE_DATE = :NEW.CREATE_DATE
          AND OW.WERKS = :NEW.WERKS
          AND OW.WORKSHOP_CODE = :NEW.WORKSHOP_CODE;
    :NEW.SPMS_WS_ID := :NEW.WERKS||'-'||:NEW.WORKSHOP_CODE||'-'||REPLACE(:NEW.CREATE_DATE, '-')||'-'||SUBSTR(1001 + V_NUM1, 2, 4);
  END;
/

-- ----------------------------
-- Triggers structure for table ORDER_WORKSHOP_DTL
-- ----------------------------
CREATE TRIGGER "SPMS"."TR_ORDER_WORKSHOP_DTL_BEF" BEFORE INSERT ON "SPMS"."ORDER_WORKSHOP_DTL" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW 
DECLARE
    WS_ID VARCHAR2(64) := 0;
    BEGIN
        SELECT OW.SPMS_WS_ID INTO WS_ID FROM ORDER_WORKSHOP OW WHERE OW.UUID = :NEW.UUID;
        :NEW.SPMS_WS_ID := WS_ID;
END;
/

-- ----------------------------
-- Primary Key structure for table OVERSEA_DELIVERY_NOTE
-- ----------------------------
ALTER TABLE "SPMS"."OVERSEA_DELIVERY_NOTE" ADD CONSTRAINT "OVERSEA_DELIVERY_NOTE_PK" PRIMARY KEY ("UUID_DELIVERY_NOTE");

-- ----------------------------
-- Checks structure for table OVERSEA_DELIVERY_NOTE
-- ----------------------------
ALTER TABLE "SPMS"."OVERSEA_DELIVERY_NOTE" ADD CONSTRAINT "SYS_C0062215" CHECK ("UUID_DELIVERY_NOTE" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Triggers structure for table OVERSEA_DELIVERY_NOTE
-- ----------------------------
CREATE TRIGGER "SPMS"."TR_OVERSEA_DELIVERY_NOTE_BEF_UPDATE" BEFORE UPDATE ON "SPMS"."OVERSEA_DELIVERY_NOTE" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW 
BEGIN
    :new.UPDATE_TIME := TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss');
    :new.DATA_VERSION := DATA_VERSION.nextval;
END;
/

-- ----------------------------
-- Primary Key structure for table OVERSEA_DELIVERY_NOTE_DTL
-- ----------------------------
ALTER TABLE "SPMS"."OVERSEA_DELIVERY_NOTE_DTL" ADD CONSTRAINT "OVERSEA_DELIVERY_NOTE_DTL_PK" PRIMARY KEY ("AUTO_ID_DELIVERY_NOTE");

-- ----------------------------
-- Checks structure for table OVERSEA_DELIVERY_NOTE_DTL
-- ----------------------------
ALTER TABLE "SPMS"."OVERSEA_DELIVERY_NOTE_DTL" ADD CONSTRAINT "SYS_C0062217" CHECK ("AUTO_ID_DELIVERY_NOTE" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Triggers structure for table OVERSEA_DELIVERY_NOTE_DTL
-- ----------------------------
CREATE TRIGGER "SPMS"."TR_OVERSEA_DELIVERY_NOTE_DTL_BEF_UPDATE" BEFORE UPDATE ON "SPMS"."OVERSEA_DELIVERY_NOTE_DTL" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW 
BEGIN
    :new.UPDATE_TIME := TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss');
    :new.DATA_VERSION := DATA_VERSION.nextval;
END;
/

-- ----------------------------
-- Primary Key structure for table OVERSEA_DN
-- ----------------------------
ALTER TABLE "SPMS"."OVERSEA_DN" ADD CONSTRAINT "OVERSEA_DN_PK" PRIMARY KEY ("UUID_DELIVERY_NOTE");

-- ----------------------------
-- Checks structure for table OVERSEA_DN
-- ----------------------------
ALTER TABLE "SPMS"."OVERSEA_DN" ADD CONSTRAINT "SYS_C0062219" CHECK ("UUID_DELIVERY_NOTE" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Triggers structure for table OVERSEA_DN
-- ----------------------------
CREATE TRIGGER "SPMS"."TR_OVERSEA_DN_BEF_UPDATE" BEFORE UPDATE ON "SPMS"."OVERSEA_DN" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW 
BEGIN
    :new.UPDATE_TIME := TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss');
    :new.DATA_VERSION := DATA_VERSION.nextval;
END;
/

-- ----------------------------
-- Primary Key structure for table OVERSEA_DN_DTL
-- ----------------------------
ALTER TABLE "SPMS"."OVERSEA_DN_DTL" ADD CONSTRAINT "OVERSEA_DN_DTL_PK" PRIMARY KEY ("AUTO_ID_DN");

-- ----------------------------
-- Checks structure for table OVERSEA_DN_DTL
-- ----------------------------
ALTER TABLE "SPMS"."OVERSEA_DN_DTL" ADD CONSTRAINT "SYS_C0062221" CHECK ("AUTO_ID_DN" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Triggers structure for table OVERSEA_DN_DTL
-- ----------------------------
CREATE TRIGGER "SPMS"."TR_OVERSEA_DN_DTL_BEF_UPDATE" BEFORE UPDATE ON "SPMS"."OVERSEA_DN_DTL" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW 
BEGIN
    :new.UPDATE_TIME := TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss');
    :new.DATA_VERSION := DATA_VERSION.nextval;
END;
/

-- ----------------------------
-- Primary Key structure for table OVERSEA_INV_CHECK
-- ----------------------------
ALTER TABLE "SPMS"."OVERSEA_INV_CHECK" ADD CONSTRAINT "OVERSEA_INV_CHECK_PK" PRIMARY KEY ("UUID");

-- ----------------------------
-- Checks structure for table OVERSEA_INV_CHECK
-- ----------------------------
ALTER TABLE "SPMS"."OVERSEA_INV_CHECK" ADD CONSTRAINT "OVSYS_C0031086" CHECK ("UUID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "SPMS"."OVERSEA_INV_CHECK" ADD CONSTRAINT "SYS_C0062223" CHECK ("UUID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Triggers structure for table OVERSEA_INV_CHECK
-- ----------------------------
CREATE TRIGGER "SPMS"."TR_OVERSEA_INV_CHECK_BEF" BEFORE UPDATE ON "SPMS"."OVERSEA_INV_CHECK" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW 
BEGIN
    :new.UPDATE_TIME := TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss');
END;
/
CREATE TRIGGER "SPMS"."TR_OVERSEA_INV_CHECK_BEF1" BEFORE INSERT ON "SPMS"."OVERSEA_INV_CHECK" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW 
DECLARE
    V_NUM1 NUMBER := 0;
BEGIN
    SELECT NVL(TO_NUMBER(SUBSTR(MAX(SOT.INVENTORY_CHECK_ID), -3, 3)), 0) INTO V_NUM1 FROM OVERSEA_INV_CHECK SOT
    WHERE SOT.CREATE_DATE = :NEW.CREATE_DATE
      AND SOT.WERKS = :NEW.WERKS
      AND SOT.WHS_LOCATION_CODE = :NEW.WHS_LOCATION_CODE;
    :NEW.INVENTORY_CHECK_ID := :NEW.WERKS||'-'||:NEW.WHS_LOCATION_CODE||'-'||REPLACE(:NEW.CREATE_DATE, '-')||'-'||SUBSTR(1001 + V_NUM1, 2, 4);
END;
/

-- ----------------------------
-- Primary Key structure for table OVERSEA_INV_CHECK_ACTION
-- ----------------------------
ALTER TABLE "SPMS"."OVERSEA_INV_CHECK_ACTION" ADD CONSTRAINT "OVERSEA_INV_CHECK_ACTION_PK" PRIMARY KEY ("UUID");

-- ----------------------------
-- Checks structure for table OVERSEA_INV_CHECK_ACTION
-- ----------------------------
ALTER TABLE "SPMS"."OVERSEA_INV_CHECK_ACTION" ADD CONSTRAINT "OVSYS_C0031088" CHECK ("UUID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "SPMS"."OVERSEA_INV_CHECK_ACTION" ADD CONSTRAINT "SYS_C0062226" CHECK ("UUID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Triggers structure for table OVERSEA_INV_CHECK_ACTION
-- ----------------------------
CREATE TRIGGER "SPMS"."TR_OVERSEA_INV_CHECK_ACTION_BEF" BEFORE UPDATE ON "SPMS"."OVERSEA_INV_CHECK_ACTION" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW 
BEGIN
    :new.UPDATE_TIME := TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss');
END;
/
CREATE TRIGGER "SPMS"."TR_OVERSEA_INV_CHECK_ACTION_ID" BEFORE INSERT ON "SPMS"."OVERSEA_INV_CHECK_ACTION" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW 
DECLARE
    V_NUM1 NUMBER := 0;
BEGIN
    SELECT NVL(TO_NUMBER(SUBSTR(MAX(SOT.SPMS_ID), -3, 3)), 0) INTO V_NUM1 FROM OVERSEA_INV_CHECK_ACTION SOT
    WHERE SOT.CREATE_DATE = :NEW.CREATE_DATE
      AND SOT.WERKS = :NEW.WERKS
      AND SOT.WHS_LOCATION_CODE = :NEW.WHS_LOCATION_CODE;
    :NEW.SPMS_ID := :NEW.WERKS||'-'||:NEW.WHS_LOCATION_CODE||'-'||REPLACE(:NEW.CREATE_DATE, '-')||'-'||SUBSTR(1001 + V_NUM1, 2, 4);
END;
/

-- ----------------------------
-- Primary Key structure for table OVERSEA_OPERATE_LOG
-- ----------------------------
ALTER TABLE "SPMS"."OVERSEA_OPERATE_LOG" ADD CONSTRAINT "OVERSEA_OPERATE_LOG_PK" PRIMARY KEY ("AUTO_ID_LOG");

-- ----------------------------
-- Checks structure for table OVERSEA_OPERATE_LOG
-- ----------------------------
ALTER TABLE "SPMS"."OVERSEA_OPERATE_LOG" ADD CONSTRAINT "SYS_C0062233" CHECK ("AUTO_ID_LOG" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Primary Key structure for table OVERSEA_OTHER_DTL
-- ----------------------------
ALTER TABLE "SPMS"."OVERSEA_OTHER_DTL" ADD CONSTRAINT "OVERSEA_OTHER_DTL_PK" PRIMARY KEY ("AUTO_ID_OTHER");

-- ----------------------------
-- Checks structure for table OVERSEA_OTHER_DTL
-- ----------------------------
ALTER TABLE "SPMS"."OVERSEA_OTHER_DTL" ADD CONSTRAINT "SYS_C0062235" CHECK ("AUTO_ID_OTHER" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Primary Key structure for table OVERSEA_OTHER_TASK
-- ----------------------------
ALTER TABLE "SPMS"."OVERSEA_OTHER_TASK" ADD CONSTRAINT "OVERSEA_OTHER_TASK_PK" PRIMARY KEY ("UUID");

-- ----------------------------
-- Checks structure for table OVERSEA_OTHER_TASK
-- ----------------------------
ALTER TABLE "SPMS"."OVERSEA_OTHER_TASK" ADD CONSTRAINT "SYS_C0062237" CHECK ("UUID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Triggers structure for table OVERSEA_OTHER_TASK
-- ----------------------------
CREATE TRIGGER "SPMS"."TR_OVERSEA_OTHER_TASK_BEF_UPDATE" BEFORE UPDATE ON "SPMS"."OVERSEA_OTHER_TASK" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW 
BEGIN
    :new.UPDATE_TIME := TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss');
    :new.DATA_VERSION := DATA_VERSION.nextval;
END;
/
CREATE TRIGGER "SPMS"."TR_OVERSEA_OTHER_TASK_INSERT" BEFORE INSERT ON "SPMS"."OVERSEA_OTHER_TASK" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW 
DECLARE
    V_NUM1 NUMBER := 0;
BEGIN
    SELECT NVL(TO_NUMBER(SUBSTR(MAX(OOT.SPMS_ID), -3, 3)), 0) INTO V_NUM1 FROM OVERSEA_OTHER_TASK OOT
    WHERE OOT.CREATE_DATE = :NEW.CREATE_DATE
      AND OOT.WERKS = :NEW.WERKS
      AND OOT.WHS_LOCATION_CODE = :NEW.WHS_LOCATION_CODE;
    :NEW.SPMS_ID := :NEW.WERKS||'-'||:NEW.WHS_LOCATION_CODE||'-'||REPLACE(:NEW.CREATE_DATE, '-')||'-'||SUBSTR(1001 + V_NUM1, 2, 4);
END;
/

-- ----------------------------
-- Primary Key structure for table OVERSEA_PACKAGE_LIST
-- ----------------------------
ALTER TABLE "SPMS"."OVERSEA_PACKAGE_LIST" ADD CONSTRAINT "OVERSEA_PACKAGE_LIST_PK" PRIMARY KEY ("UUID_PACKAGE_LIST");

-- ----------------------------
-- Checks structure for table OVERSEA_PACKAGE_LIST
-- ----------------------------
ALTER TABLE "SPMS"."OVERSEA_PACKAGE_LIST" ADD CONSTRAINT "SYS_C0062239" CHECK ("UUID_PACKAGE_LIST" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Triggers structure for table OVERSEA_PACKAGE_LIST
-- ----------------------------
CREATE TRIGGER "SPMS"."TR_OVERSEA_PACKAGE_LIST_BEF_UPDATE" BEFORE UPDATE ON "SPMS"."OVERSEA_PACKAGE_LIST" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW 
BEGIN
    :new.UPDATE_TIME := TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss');
END;
/

-- ----------------------------
-- Primary Key structure for table OVERSEA_PACKAGE_LIST_BOX
-- ----------------------------
ALTER TABLE "SPMS"."OVERSEA_PACKAGE_LIST_BOX" ADD CONSTRAINT "OVERSEA_PACKAGE_LIST_BOX_PK" PRIMARY KEY ("AUTO_ID_PACKAGE_BOX");

-- ----------------------------
-- Checks structure for table OVERSEA_PACKAGE_LIST_BOX
-- ----------------------------
ALTER TABLE "SPMS"."OVERSEA_PACKAGE_LIST_BOX" ADD CONSTRAINT "SYS_C0062241" CHECK ("AUTO_ID_PACKAGE_BOX" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Indexes structure for table OVERSEA_PACKAGE_LIST_BOX
-- ----------------------------
CREATE UNIQUE INDEX "SPMS"."OVERSEA_PACKAGE_LIST_BOX_AUTO_ID_PACKAGE_BOX_UINDEX"
  ON "SPMS"."OVERSEA_PACKAGE_LIST_BOX" ("AUTO_ID_PACKAGE_BOX" ASC) LOCAL
  LOGGING
  ONLINE
  NOSORT
  VISIBLE
PCTFREE 10
INITRANS 2
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
  FLASH_CACHE DEFAULT
)
   USABLE;

-- ----------------------------
-- Triggers structure for table OVERSEA_PACKAGE_LIST_BOX
-- ----------------------------
CREATE TRIGGER "SPMS"."TR_OVERSEA_PACKAGE_LIST_BOX_BEF_UPDATE" BEFORE UPDATE ON "SPMS"."OVERSEA_PACKAGE_LIST_BOX" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW 
BEGIN
    :new.UPDATE_TIME := TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss');
END;
/

-- ----------------------------
-- Primary Key structure for table OVERSEA_PACKAGE_LIST_DTL
-- ----------------------------
ALTER TABLE "SPMS"."OVERSEA_PACKAGE_LIST_DTL" ADD CONSTRAINT "OVERSEA_PACKAGE_LIST_TDL_PK" PRIMARY KEY ("AUTO_ID_PACKAGE_LIST");

-- ----------------------------
-- Checks structure for table OVERSEA_PACKAGE_LIST_DTL
-- ----------------------------
ALTER TABLE "SPMS"."OVERSEA_PACKAGE_LIST_DTL" ADD CONSTRAINT "SYS_C0062243" CHECK ("AUTO_ID_PACKAGE_LIST" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Triggers structure for table OVERSEA_PACKAGE_LIST_DTL
-- ----------------------------
CREATE TRIGGER "SPMS"."TR_OVERSEA_PACKAGE_LIST_DTL_BEF_UPDATE" BEFORE UPDATE ON "SPMS"."OVERSEA_PACKAGE_LIST_DTL" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW 
BEGIN
    :new.UPDATE_TIME := TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss');
END;
/

-- ----------------------------
-- Primary Key structure for table OVERSEA_PURCHASE_ORDER
-- ----------------------------
ALTER TABLE "SPMS"."OVERSEA_PURCHASE_ORDER" ADD CONSTRAINT "OVERSEA_PURCHASE_ORDER_PK" PRIMARY KEY ("UUID_PURCHASE_ORDER");

-- ----------------------------
-- Checks structure for table OVERSEA_PURCHASE_ORDER
-- ----------------------------
ALTER TABLE "SPMS"."OVERSEA_PURCHASE_ORDER" ADD CONSTRAINT "SYS_C0062245" CHECK ("UUID_PURCHASE_ORDER" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Triggers structure for table OVERSEA_PURCHASE_ORDER
-- ----------------------------
CREATE TRIGGER "SPMS"."TR_OVERSEA_PURCHASE_ORDER_BEF_UPDATE" BEFORE UPDATE ON "SPMS"."OVERSEA_PURCHASE_ORDER" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW 
BEGIN
    :new.UPDATE_TIME := TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss');
    :new.DATA_VERSION := DATA_VERSION.nextval;
END;
/

-- ----------------------------
-- Primary Key structure for table OVERSEA_PURCHASE_ORDER_DTL
-- ----------------------------
ALTER TABLE "SPMS"."OVERSEA_PURCHASE_ORDER_DTL" ADD CONSTRAINT "OVERSEA_PURCHASE_ORDER_DTL_PK" PRIMARY KEY ("AUTO_ID_PURCHASE_ORDER");

-- ----------------------------
-- Checks structure for table OVERSEA_PURCHASE_ORDER_DTL
-- ----------------------------
ALTER TABLE "SPMS"."OVERSEA_PURCHASE_ORDER_DTL" ADD CONSTRAINT "SYS_C0062247" CHECK ("AUTO_ID_PURCHASE_ORDER" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Triggers structure for table OVERSEA_PURCHASE_ORDER_DTL
-- ----------------------------
CREATE TRIGGER "SPMS"."TR_OVERSEA_PURCHASE_ORDER_DTL_BEF_UPDATE" BEFORE UPDATE ON "SPMS"."OVERSEA_PURCHASE_ORDER_DTL" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW 
BEGIN
    :new.UPDATE_TIME := TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss');
    :new.DATA_VERSION := DATA_VERSION.nextval;
END;
/

-- ----------------------------
-- Primary Key structure for table OVERSEA_REQUISITION
-- ----------------------------
ALTER TABLE "SPMS"."OVERSEA_REQUISITION" ADD CONSTRAINT "OVERSEA_REQUISITION_PK" PRIMARY KEY ("UUID_REQUISITION");

-- ----------------------------
-- Checks structure for table OVERSEA_REQUISITION
-- ----------------------------
ALTER TABLE "SPMS"."OVERSEA_REQUISITION" ADD CONSTRAINT "SYS_C0062249" CHECK ("UUID_REQUISITION" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Triggers structure for table OVERSEA_REQUISITION
-- ----------------------------
CREATE TRIGGER "SPMS"."TR_OVERSEA_REQUISITION_BEF_UPDATE" BEFORE UPDATE ON "SPMS"."OVERSEA_REQUISITION" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW 
BEGIN
    :new.UPDATE_TIME := TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss');
    :new.DATA_VERSION := DATA_VERSION.nextval;
END;
/
CREATE TRIGGER "SPMS"."TR_OVERSEA_REQUISITION_INSERT" BEFORE INSERT ON "SPMS"."OVERSEA_REQUISITION" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW 
DECLARE
    V_NUM1 NUMBER := 0;
BEGIN
    SELECT NVL(TO_NUMBER(SUBSTR(MAX(ORQ.SPMS_ID), -3, 3)), 0) INTO V_NUM1 FROM OVERSEA_REQUISITION ORQ
    WHERE ORQ.CREATE_DATE = :NEW.CREATE_DATE
      AND ORQ.WERKS = :NEW.WERKS
      AND ORQ.WORKSHOP_CODE = :NEW.WORKSHOP_CODE;
    :NEW.SPMS_ID := :NEW.WERKS||'-'||:NEW.WORKSHOP_CODE||'-'||REPLACE(:NEW.CREATE_DATE, '-')||'-'||SUBSTR(1001 + V_NUM1, 2, 4);
END;
/

-- ----------------------------
-- Primary Key structure for table OVERSEA_REQUISITION_DTL
-- ----------------------------
ALTER TABLE "SPMS"."OVERSEA_REQUISITION_DTL" ADD CONSTRAINT "OVERSEA_REQUISITION_DTL_PK" PRIMARY KEY ("AUTO_ID_REQUISITION_DTL");

-- ----------------------------
-- Checks structure for table OVERSEA_REQUISITION_DTL
-- ----------------------------
ALTER TABLE "SPMS"."OVERSEA_REQUISITION_DTL" ADD CONSTRAINT "SYS_C0062251" CHECK ("AUTO_ID_REQUISITION_DTL" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Primary Key structure for table OVERSEA_WHS_DUMP
-- ----------------------------
ALTER TABLE "SPMS"."OVERSEA_WHS_DUMP" ADD CONSTRAINT "OVERSEA_WHS_DUMP_PK" PRIMARY KEY ("WHS_DUMP_UUID");

-- ----------------------------
-- Checks structure for table OVERSEA_WHS_DUMP
-- ----------------------------
ALTER TABLE "SPMS"."OVERSEA_WHS_DUMP" ADD CONSTRAINT "SYS_C0062253" CHECK ("WHS_DUMP_UUID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Triggers structure for table OVERSEA_WHS_DUMP
-- ----------------------------
CREATE TRIGGER "SPMS"."TR_OVERSEA_WHS_DUMP_BEF_UPDATE" BEFORE UPDATE ON "SPMS"."OVERSEA_WHS_DUMP" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW 
BEGIN
    :new.UPDATE_TIME := TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss');
    :new.DATA_VERSION := DATA_VERSION.nextval;
END;
/
CREATE TRIGGER "SPMS"."TR_OVERSEA_WHS_DUMP_INSERT" BEFORE INSERT ON "SPMS"."OVERSEA_WHS_DUMP" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW 
DECLARE
    V_NUM1 NUMBER := 0;
BEGIN
    SELECT NVL(TO_NUMBER(SUBSTR(MAX(OWD.WHS_DUMP_NO), -3, 3)), 0) INTO V_NUM1 FROM OVERSEA_WHS_DUMP OWD
    WHERE OWD.CREATE_DATE = :NEW.CREATE_DATE
      AND OWD.WERKS_DUMP_OUT = :NEW.WERKS_DUMP_OUT
      AND OWD.WHS_LOCATION_CODE_DUMP_OUT = :NEW.WHS_LOCATION_CODE_DUMP_OUT;
    :NEW.WHS_DUMP_NO := :NEW.WERKS_DUMP_OUT||'-'||:NEW.WHS_LOCATION_CODE_DUMP_OUT||'-'||REPLACE(:NEW.CREATE_DATE, '-')||'-'||SUBSTR(1001 + V_NUM1, 2, 4);
END;
/

-- ----------------------------
-- Primary Key structure for table OVERSEA_WHS_DUMP_DTL
-- ----------------------------
ALTER TABLE "SPMS"."OVERSEA_WHS_DUMP_DTL" ADD CONSTRAINT "OVERSEA_WHS_DUMP_DTL_PK" PRIMARY KEY ("AUTO_ID_DUMP_DTL");

-- ----------------------------
-- Checks structure for table OVERSEA_WHS_DUMP_DTL
-- ----------------------------
ALTER TABLE "SPMS"."OVERSEA_WHS_DUMP_DTL" ADD CONSTRAINT "SYS_C0062255" CHECK ("AUTO_ID_DUMP_DTL" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Primary Key structure for table OVERSEA_WHS_IN
-- ----------------------------
ALTER TABLE "SPMS"."OVERSEA_WHS_IN" ADD CONSTRAINT "OVERSEA_WHS_IN_PK" PRIMARY KEY ("UUID_WHS_IN");

-- ----------------------------
-- Checks structure for table OVERSEA_WHS_IN
-- ----------------------------
ALTER TABLE "SPMS"."OVERSEA_WHS_IN" ADD CONSTRAINT "SYS_C0062257" CHECK ("UUID_WHS_IN" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Triggers structure for table OVERSEA_WHS_IN
-- ----------------------------
CREATE TRIGGER "SPMS"."TR_OVERSEA_WHS_IN_BEF_INSERT" BEFORE INSERT ON "SPMS"."OVERSEA_WHS_IN" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW 
DECLARE
    V_NUM1 NUMBER := 0;
BEGIN
    SELECT NVL(TO_NUMBER(SUBSTR(MAX(WI.WHS_IN_NO), 15, 17)), 0) INTO V_NUM1 FROM OVERSEA_WHS_IN WI
    WHERE WI.CREATE_DATE = :NEW.CREATE_DATE AND WI.WERKS = :NEW.WERKS;
    :NEW.WHS_IN_NO := :NEW.WERKS||'-'||REPLACE(:NEW.CREATE_DATE, '-', '')|| '-'|| SUBSTR(1001 + V_NUM1, 2, 4);
END;
/
CREATE TRIGGER "SPMS"."TR_OVERSEA_WHS_IN_BEF_UPDATE" BEFORE UPDATE ON "SPMS"."OVERSEA_WHS_IN" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW 
BEGIN
    :new.UPDATE_TIME := TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss');
    :new.DATA_VERSION := DATA_VERSION.nextval;
END;
/

-- ----------------------------
-- Primary Key structure for table OVERSEA_WHS_IN_DTL
-- ----------------------------
ALTER TABLE "SPMS"."OVERSEA_WHS_IN_DTL" ADD CONSTRAINT "OVERSEA_WHS_IN_DTL_PK" PRIMARY KEY ("AUTO_ID_WHS_IN_DTL");

-- ----------------------------
-- Checks structure for table OVERSEA_WHS_IN_DTL
-- ----------------------------
ALTER TABLE "SPMS"."OVERSEA_WHS_IN_DTL" ADD CONSTRAINT "SYS_C0062259" CHECK ("AUTO_ID_WHS_IN_DTL" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Primary Key structure for table OVERSEA_WHS_MOVE
-- ----------------------------
ALTER TABLE "SPMS"."OVERSEA_WHS_MOVE" ADD CONSTRAINT "OVERSEA_WHS_MOVE_PK" PRIMARY KEY ("UUID");

-- ----------------------------
-- Checks structure for table OVERSEA_WHS_MOVE
-- ----------------------------
ALTER TABLE "SPMS"."OVERSEA_WHS_MOVE" ADD CONSTRAINT "SYS_C0063329" CHECK ("UUID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Triggers structure for table OVERSEA_WHS_MOVE
-- ----------------------------
CREATE TRIGGER "SPMS"."TR_OVERSEA_WHS_MOVE_BEF" BEFORE INSERT ON "SPMS"."OVERSEA_WHS_MOVE" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW 
DECLARE
    V_NUM1 NUMBER := 0;
BEGIN
    SELECT NVL(TO_NUMBER(SUBSTR(MAX(OWM.WHS_MOVE_NO), -3, 3)), 0) INTO V_NUM1 FROM OVERSEA_WHS_MOVE OWM
    WHERE OWM.CREATE_DATE = :NEW.CREATE_DATE
      AND OWM.WERKS_MOVE_OUT = :NEW.WERKS_MOVE_OUT;
    :NEW.WHS_MOVE_NO := :NEW.WERKS_MOVE_OUT||'-'||REPLACE(:NEW.CREATE_DATE, '-')||'-'|| SUBSTR(1001 + V_NUM1, 2, 4);
END;
/
CREATE TRIGGER "SPMS"."TR_OVERSEA_WHS_MOVE_BEF_UPDATE" BEFORE UPDATE ON "SPMS"."OVERSEA_WHS_MOVE" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW 
BEGIN
    :new.UPDATE_TIME := TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss');
    :new.DATA_VERSION := DATA_VERSION.nextval;
END;
/

-- ----------------------------
-- Primary Key structure for table OVERSEA_WHS_OUT
-- ----------------------------
ALTER TABLE "SPMS"."OVERSEA_WHS_OUT" ADD CONSTRAINT "OVERSEA_WHS_OUT_PK" PRIMARY KEY ("UUID_WHS_OUT");

-- ----------------------------
-- Checks structure for table OVERSEA_WHS_OUT
-- ----------------------------
ALTER TABLE "SPMS"."OVERSEA_WHS_OUT" ADD CONSTRAINT "SYS_C0062261" CHECK ("UUID_WHS_OUT" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Triggers structure for table OVERSEA_WHS_OUT
-- ----------------------------
CREATE TRIGGER "SPMS"."TR_OVERSEA_WHS_OUT_BEF_UPDATE" BEFORE UPDATE ON "SPMS"."OVERSEA_WHS_OUT" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW 
BEGIN
    :new.UPDATE_TIME := TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss');
    :new.DATA_VERSION := DATA_VERSION.nextval;
END;
/
CREATE TRIGGER "SPMS"."TR_OVERSEA_WHS_OUT_INSERT" BEFORE INSERT ON "SPMS"."OVERSEA_WHS_OUT" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW 
DECLARE
    V_NUM1 NUMBER := 0;
BEGIN
    SELECT NVL(TO_NUMBER(SUBSTR(MAX(OWO.SPMS_ID), -3, 3)), 0) INTO V_NUM1 FROM OVERSEA_WHS_OUT OWO
    WHERE OWO.CREATE_DATE = :NEW.CREATE_DATE
      AND OWO.WERKS = :NEW.WERKS
      AND OWO.WHS_LOCATION_CODE = :NEW.WHS_LOCATION_CODE;
    :NEW.SPMS_ID := :NEW.WERKS||'-'||:NEW.WHS_LOCATION_CODE||'-'||REPLACE(:NEW.CREATE_DATE, '-')||'-'||SUBSTR(1001 + V_NUM1, 2, 4);
END;
/

-- ----------------------------
-- Primary Key structure for table OVERSEA_WHS_OUT_DTL
-- ----------------------------
ALTER TABLE "SPMS"."OVERSEA_WHS_OUT_DTL" ADD CONSTRAINT "SYS_C0062264" PRIMARY KEY ("AUTO_ID_WHS_OUT_DTL");

-- ----------------------------
-- Checks structure for table OVERSEA_WHS_OUT_DTL
-- ----------------------------
ALTER TABLE "SPMS"."OVERSEA_WHS_OUT_DTL" ADD CONSTRAINT "SYS_C0062263" CHECK ("AUTO_ID_WHS_OUT_DTL" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Primary Key structure for table PURCHASE_PATTERN
-- ----------------------------
ALTER TABLE "SPMS"."PURCHASE_PATTERN" ADD CONSTRAINT "SYS_C0010893" PRIMARY KEY ("PATTERN_ID");

-- ----------------------------
-- Checks structure for table PURCHASE_PATTERN
-- ----------------------------
ALTER TABLE "SPMS"."PURCHASE_PATTERN" ADD CONSTRAINT "SYS_C0010892" CHECK ("PATTERN_ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "SPMS"."PURCHASE_PATTERN" ADD CONSTRAINT "SYS_C0013795" CHECK ("PATTERN_ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Triggers structure for table PURCHASE_PATTERN
-- ----------------------------
CREATE TRIGGER "SPMS"."TR_PURCHASE_PATTERN_BEF" BEFORE UPDATE ON "SPMS"."PURCHASE_PATTERN" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW 
BEGIN
:new.UPDATE_DATE := TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss');
END;
/

-- ----------------------------
-- Primary Key structure for table SAFETY_INVENTORY
-- ----------------------------
ALTER TABLE "SPMS"."SAFETY_INVENTORY" ADD CONSTRAINT "SAFETY_INVENTORY_PK" PRIMARY KEY ("UUID");

-- ----------------------------
-- Checks structure for table SAFETY_INVENTORY
-- ----------------------------
ALTER TABLE "SPMS"."SAFETY_INVENTORY" ADD CONSTRAINT "SYS_C0062269" CHECK ("UUID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Triggers structure for table SAFETY_INVENTORY
-- ----------------------------
CREATE TRIGGER "SPMS"."TR_SAFETY_INVENTORY_BEF_UPDATE" BEFORE UPDATE ON "SPMS"."SAFETY_INVENTORY" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW 
BEGIN
    :new.UPDATE_TIME := TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss');
    :new.DATA_VERSION := DATA_VERSION.nextval;
END;
/

-- ----------------------------
-- Primary Key structure for table SAP_BOX_NOTE
-- ----------------------------
ALTER TABLE "SPMS"."SAP_BOX_NOTE" ADD CONSTRAINT "SYS_C0023267" PRIMARY KEY ("BOX_NOTE");

-- ----------------------------
-- Checks structure for table SAP_BOX_NOTE
-- ----------------------------
ALTER TABLE "SPMS"."SAP_BOX_NOTE" ADD CONSTRAINT "SYS_C0013796" CHECK ("BOX_NOTE" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "SPMS"."SAP_BOX_NOTE" ADD CONSTRAINT "SYS_C0023266" CHECK ("BOX_NOTE" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Triggers structure for table SAP_BOX_NOTE
-- ----------------------------
CREATE TRIGGER "SPMS"."CREATE_TIME" BEFORE UPDATE ON "SPMS"."SAP_BOX_NOTE" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW 
BEGIN
    :new.CREATE_TIME := TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss');
END;
/
CREATE TRIGGER "SPMS"."TR_SAP_BOX_NOTE" BEFORE INSERT ON "SPMS"."SAP_BOX_NOTE" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW 
DECLARE
    NUM NUMBER := 0;
BEGIN
    SELECT COUNT(*) INTO NUM FROM SAP_BOX_NOTE SBN WHERE SBN.BOX_NOTE = :NEW.BOX_NOTE;
    if NUM = 1 THEN
        DELETE FROM SAP_BOX_NOTE SBN WHERE SBN.BOX_NOTE = :NEW.BOX_NOTE;
    end if;
end;
/

-- ----------------------------
-- Primary Key structure for table SAP_DELIVERY_NOTE
-- ----------------------------
ALTER TABLE "SPMS"."SAP_DELIVERY_NOTE" ADD CONSTRAINT "SYS_C0022009" PRIMARY KEY ("DELIVERY_NOTE_SAP");

-- ----------------------------
-- Checks structure for table SAP_DELIVERY_NOTE
-- ----------------------------
ALTER TABLE "SPMS"."SAP_DELIVERY_NOTE" ADD CONSTRAINT "SYS_C0013797" CHECK ("DELIVERY_NOTE_SAP" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "SPMS"."SAP_DELIVERY_NOTE" ADD CONSTRAINT "SYS_C0022008" CHECK ("DELIVERY_NOTE_SAP" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Triggers structure for table SAP_DELIVERY_NOTE
-- ----------------------------
CREATE TRIGGER "SPMS"."TR_SAP_DELIVERY_NOTE_BEF" BEFORE UPDATE ON "SPMS"."SAP_DELIVERY_NOTE" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW 
BEGIN
    :new.UPDATE_TIME := TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss');
END;
/

-- ----------------------------
-- Triggers structure for table SAP_DELIVERY_NOTE_DTL
-- ----------------------------
CREATE TRIGGER "SPMS"."TR_SAP_DELIVERY_NOTE_DTL_BEF_INSERT" BEFORE INSERT ON "SPMS"."SAP_DELIVERY_NOTE_DTL" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW 
DECLARE
    V_NUM1 NUMBER := 0;
BEGIN
    IF (NVL(:NEW.SPMS_ITEM, 0) = 0)
    THEN
        SELECT NVL(MAX(SDND.SPMS_ITEM), 0) INTO V_NUM1 FROM SAP_DELIVERY_NOTE_DTL SDND WHERE SDND.DELIVERY_NOTE_SAP = :NEW.DELIVERY_NOTE_SAP;
        :NEW.SPMS_ITEM := V_NUM1 + 10;
    END IF;
END;
/
CREATE TRIGGER "SPMS"."TR_SAP_DELIVERY_NOTE_DTL_BEF_UPDATE" BEFORE UPDATE ON "SPMS"."SAP_DELIVERY_NOTE_DTL" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW 
BEGIN
    :new.UPDATE_TIME := TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss');
END;
/

-- ----------------------------
-- Primary Key structure for table SAP_DELIVERY_NOTE_LOG
-- ----------------------------
ALTER TABLE "SPMS"."SAP_DELIVERY_NOTE_LOG" ADD CONSTRAINT "SYS_C0015242" PRIMARY KEY ("UUID");

-- ----------------------------
-- Checks structure for table SAP_DELIVERY_NOTE_LOG
-- ----------------------------
ALTER TABLE "SPMS"."SAP_DELIVERY_NOTE_LOG" ADD CONSTRAINT "SYS_C0015241" CHECK ("UUID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Indexes structure for table SAP_DELIVERY_NOTE_LOG
-- ----------------------------
CREATE INDEX "SPMS"."INDEX_DN_LOG_AUTO_ID"
  ON "SPMS"."SAP_DELIVERY_NOTE_LOG" ("LOG_AUTO_ID" ASC)
  LOGGING
  VISIBLE
PCTFREE 10
INITRANS 2
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
  FLASH_CACHE DEFAULT
)
   USABLE;

-- ----------------------------
-- Triggers structure for table SAP_DELIVERY_NOTE_LOG
-- ----------------------------
CREATE TRIGGER "SPMS"."TR_SAP_DELIVERY_NOTE_LOG_BEF" BEFORE INSERT ON "SPMS"."SAP_DELIVERY_NOTE_LOG" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW 
DECLARE
    V_NUM1 NUMBER := 0;
BEGIN
    SELECT NVL(TO_NUMBER(MAX(DNL.LOG_AUTO_ID)), 0) INTO V_NUM1 FROM SAP_DELIVERY_NOTE_LOG DNL;
    :NEW.LOG_AUTO_ID := V_NUM1 + 1;
END;
/

-- ----------------------------
-- Primary Key structure for table SAP_DELIVERY_NOTE_SPMS
-- ----------------------------
ALTER TABLE "SPMS"."SAP_DELIVERY_NOTE_SPMS" ADD CONSTRAINT "SYS_C0022013" PRIMARY KEY ("SPMS_UUID");

-- ----------------------------
-- Checks structure for table SAP_DELIVERY_NOTE_SPMS
-- ----------------------------
ALTER TABLE "SPMS"."SAP_DELIVERY_NOTE_SPMS" ADD CONSTRAINT "SYS_C0013799" CHECK ("SPMS_UUID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "SPMS"."SAP_DELIVERY_NOTE_SPMS" ADD CONSTRAINT "SYS_C0013800" CHECK ("DELIVERY_NOTE_SAP" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "SPMS"."SAP_DELIVERY_NOTE_SPMS" ADD CONSTRAINT "SYS_C0022012" CHECK ("DELIVERY_NOTE_SAP" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Checks structure for table SAP_PACKAGE_LIST
-- ----------------------------
ALTER TABLE "SPMS"."SAP_PACKAGE_LIST" ADD CONSTRAINT "SYS_C0015247" CHECK ("PACKAGE_LIST" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Triggers structure for table SAP_PACKAGE_LIST
-- ----------------------------
CREATE TRIGGER "SPMS"."TR_SAP_PACKAGE_LIST_BEF" BEFORE UPDATE ON "SPMS"."SAP_PACKAGE_LIST" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW 
BEGIN
    :new.UPDATE_TIME := TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss');
END;
/

-- ----------------------------
-- Triggers structure for table SAP_PACKAGE_LIST_DTL
-- ----------------------------
CREATE TRIGGER "SPMS"."TR_SAP_PACKAGE_LIST_DTL_BEF" BEFORE INSERT ON "SPMS"."SAP_PACKAGE_LIST_DTL" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW 
DECLARE
    V_NUM1 NUMBER := 0;
BEGIN
    IF (NVL(:NEW.ITEM, 'IS NULL') = 'IS NULL')
    THEN
        SELECT NVL(TO_NUMBER(MAX(TO_NUMBER(PLD.ITEM))), 0) INTO V_NUM1 FROM SAP_PACKAGE_LIST_DTL PLD
        WHERE PLD.PACKAGE_LIST = :NEW.PACKAGE_LIST;
        :NEW.ITEM := TO_CHAR(V_NUM1 + 10);
    END IF;
END;
/
CREATE TRIGGER "SPMS"."TR_SAP_PACKAGE_LIST_DTL_BEF_UPDATE" BEFORE UPDATE ON "SPMS"."SAP_PACKAGE_LIST_DTL" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW 
BEGIN
    :new.UPDATE_TIME := TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss');
END;
/

-- ----------------------------
-- Primary Key structure for table SAP_PACKAGE_NOTE
-- ----------------------------
ALTER TABLE "SPMS"."SAP_PACKAGE_NOTE" ADD CONSTRAINT "SYS_C0023265" PRIMARY KEY ("PACKAGE_NOTE");

-- ----------------------------
-- Checks structure for table SAP_PACKAGE_NOTE
-- ----------------------------
ALTER TABLE "SPMS"."SAP_PACKAGE_NOTE" ADD CONSTRAINT "SYS_C0013801" CHECK ("PACKAGE_NOTE" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "SPMS"."SAP_PACKAGE_NOTE" ADD CONSTRAINT "SYS_C0023264" CHECK ("PACKAGE_NOTE" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Primary Key structure for table SHELF_ON_TASK
-- ----------------------------
ALTER TABLE "SPMS"."SHELF_ON_TASK" ADD CONSTRAINT "SHELF_ON_TASK_PK" PRIMARY KEY ("UUID");

-- ----------------------------
-- Checks structure for table SHELF_ON_TASK
-- ----------------------------
ALTER TABLE "SPMS"."SHELF_ON_TASK" ADD CONSTRAINT "SYS_C0016976" CHECK ("UUID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Triggers structure for table SHELF_ON_TASK
-- ----------------------------
CREATE TRIGGER "SPMS"."TR_SHELF_ON_TASK_BEF" BEFORE UPDATE ON "SPMS"."SHELF_ON_TASK" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW 
BEGIN
    :new.UPDATE_TIME := TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss');
END;
/
CREATE TRIGGER "SPMS"."TR_SHELF_ON_TASK_BEF1" BEFORE INSERT ON "SPMS"."SHELF_ON_TASK" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW 
DECLARE
    V_NUM1 NUMBER := 0;
BEGIN
    SELECT NVL(TO_NUMBER(SUBSTR(MAX(SOT.TASK_ID), -3, 3)), 0) INTO V_NUM1 FROM SHELF_ON_TASK SOT
    WHERE SOT.CREATE_DATE = :NEW.CREATE_DATE
      AND SOT.WERKS = :NEW.WERKS
      AND SOT.WHS_LOCATION_CODE = :NEW.WHS_LOCATION_CODE;
    :NEW.TASK_ID := :NEW.WERKS||'-'||:NEW.WHS_LOCATION_CODE||'-'||REPLACE(:NEW.CREATE_DATE, '-')||'-'||SUBSTR(1001 + V_NUM1, 2, 4);
END;
/

-- ----------------------------
-- Checks structure for table SHOPPING_CART
-- ----------------------------
ALTER TABLE "SPMS"."SHOPPING_CART" ADD CONSTRAINT "SYS_C0010890" CHECK ("WORK_CODE" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "SPMS"."SHOPPING_CART" ADD CONSTRAINT "SYS_C0010891" CHECK ("MATERIAL_NO" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "SPMS"."SHOPPING_CART" ADD CONSTRAINT "SYS_C0013803" CHECK ("WORK_CODE" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "SPMS"."SHOPPING_CART" ADD CONSTRAINT "SYS_C0013804" CHECK ("MATERIAL_NO" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Triggers structure for table SHOPPING_CART
-- ----------------------------
CREATE TRIGGER "SPMS"."TR_SHOPPING_CART_BEF" BEFORE UPDATE ON "SPMS"."SHOPPING_CART" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW 
BEGIN
:new.UPDATE_TIME := TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss');
END;
/

-- ----------------------------
-- Primary Key structure for table SHOPPING_SCENARIO
-- ----------------------------
ALTER TABLE "SPMS"."SHOPPING_SCENARIO" ADD CONSTRAINT "SHOPPING_SCENARIO_PK" PRIMARY KEY ("UUID");

-- ----------------------------
-- Checks structure for table SHOPPING_SCENARIO
-- ----------------------------
ALTER TABLE "SPMS"."SHOPPING_SCENARIO" ADD CONSTRAINT "SYS_C0013805" CHECK ("UUID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "SPMS"."SHOPPING_SCENARIO" ADD CONSTRAINT "SYS_C0018160" CHECK ("UUID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Triggers structure for table SHOPPING_SCENARIO
-- ----------------------------
CREATE TRIGGER "SPMS"."TR_SHOPPING_SCENARIO_BEF" BEFORE UPDATE ON "SPMS"."SHOPPING_SCENARIO" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW 
BEGIN
    :new.UPDATE_TIME := TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss');
END;
/
CREATE TRIGGER "SPMS"."TR_SHOPPING_SCENARIO_BEF1" BEFORE INSERT ON "SPMS"."SHOPPING_SCENARIO" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW 
DECLARE
    V_NUM1 NUMBER := 0;
BEGIN
    SELECT NVL(TO_NUMBER(SUBSTR(MAX(SS.SCENARIO_ID), -3, 3)), 0) INTO V_NUM1 FROM SHOPPING_SCENARIO SS
    WHERE SS.WERKS = :NEW.WERKS;
    :NEW.SCENARIO_ID := :NEW.WERKS||'-'||SUBSTR(1001 + V_NUM1, 2, 4);
END;
/

-- ----------------------------
-- Primary Key structure for table SPMS_PERMISSION
-- ----------------------------
ALTER TABLE "SPMS"."SPMS_PERMISSION" ADD CONSTRAINT "SYS_C0019564" PRIMARY KEY ("PERMISSION_ID");

-- ----------------------------
-- Checks structure for table SPMS_PERMISSION
-- ----------------------------
ALTER TABLE "SPMS"."SPMS_PERMISSION" ADD CONSTRAINT "SYS_C0013806" CHECK ("PERMISSION_ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Triggers structure for table SPMS_PERMISSION
-- ----------------------------
CREATE TRIGGER "SPMS"."TR_SPMS_PERMISSION_BEF" BEFORE UPDATE ON "SPMS"."SPMS_PERMISSION" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW 
BEGIN
:new.UPDATE_TIME := TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss');
END;
/

-- ----------------------------
-- Primary Key structure for table SPMS_ROLE
-- ----------------------------
ALTER TABLE "SPMS"."SPMS_ROLE" ADD CONSTRAINT "SYS_C0019560" PRIMARY KEY ("UUID");

-- ----------------------------
-- Checks structure for table SPMS_ROLE
-- ----------------------------
ALTER TABLE "SPMS"."SPMS_ROLE" ADD CONSTRAINT "SYS_C0013807" CHECK ("UUID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "SPMS"."SPMS_ROLE" ADD CONSTRAINT "SYS_C0013808" CHECK ("ROLE_ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "SPMS"."SPMS_ROLE" ADD CONSTRAINT "SYS_C0019559" CHECK ("ROLE_ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Triggers structure for table SPMS_ROLE
-- ----------------------------
CREATE TRIGGER "SPMS"."TR_SPMS_ROLE_BEF" BEFORE UPDATE ON "SPMS"."SPMS_ROLE" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW 
BEGIN
:new.UPDATE_TIME := TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss');
END;
/

-- ----------------------------
-- Primary Key structure for table SPMS_ROLE_PERMISSION
-- ----------------------------
ALTER TABLE "SPMS"."SPMS_ROLE_PERMISSION" ADD CONSTRAINT "SYS_C0019566" PRIMARY KEY ("UUID");

-- ----------------------------
-- Checks structure for table SPMS_ROLE_PERMISSION
-- ----------------------------
ALTER TABLE "SPMS"."SPMS_ROLE_PERMISSION" ADD CONSTRAINT "SYS_C0013809" CHECK ("UUID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "SPMS"."SPMS_ROLE_PERMISSION" ADD CONSTRAINT "SYS_C0019565" CHECK ("UUID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Primary Key structure for table SPMS_USER
-- ----------------------------
ALTER TABLE "SPMS"."SPMS_USER" ADD CONSTRAINT "SYS_C0024750" PRIMARY KEY ("WORK_CODE");

-- ----------------------------
-- Checks structure for table SPMS_USER
-- ----------------------------
ALTER TABLE "SPMS"."SPMS_USER" ADD CONSTRAINT "SYS_C0013910" CHECK ("WORK_CODE" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "SPMS"."SPMS_USER" ADD CONSTRAINT "SYS_C0024749" CHECK ("WORK_CODE" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Primary Key structure for table SPMS_USER_ROLE
-- ----------------------------
ALTER TABLE "SPMS"."SPMS_USER_ROLE" ADD CONSTRAINT "SYS_C0024788" PRIMARY KEY ("UUID");

-- ----------------------------
-- Checks structure for table SPMS_USER_ROLE
-- ----------------------------
ALTER TABLE "SPMS"."SPMS_USER_ROLE" ADD CONSTRAINT "SYS_C0013913" CHECK ("UUID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "SPMS"."SPMS_USER_ROLE" ADD CONSTRAINT "SYS_C0024787" CHECK ("UUID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Primary Key structure for table SYS_LOG
-- ----------------------------
ALTER TABLE "SPMS"."SYS_LOG" ADD CONSTRAINT "SYS_LOG_PK" PRIMARY KEY ("UUID");

-- ----------------------------
-- Checks structure for table SYS_LOG
-- ----------------------------
ALTER TABLE "SPMS"."SYS_LOG" ADD CONSTRAINT "SYS_C0015243" CHECK ("UUID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Indexes structure for table SYS_LOG
-- ----------------------------
CREATE INDEX "SPMS"."INDEX_SYS_LOG_AUTO_ID"
  ON "SPMS"."SYS_LOG" ("LOG_AUTO_ID" ASC)
  LOGGING
  VISIBLE
PCTFREE 10
INITRANS 2
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
  FLASH_CACHE DEFAULT
)
   USABLE;

-- ----------------------------
-- Triggers structure for table SYS_LOG
-- ----------------------------
CREATE TRIGGER "SPMS"."TR_SYS_LOG_BEF" BEFORE INSERT ON "SPMS"."SYS_LOG" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW 
DECLARE
    V_NUM1 NUMBER := 0;
BEGIN
    SELECT NVL(TO_NUMBER(MAX(LOG.LOG_AUTO_ID)), 0) INTO V_NUM1 FROM SYS_LOG LOG;
    :NEW.LOG_AUTO_ID := V_NUM1 + 1;
END;
/

-- ----------------------------
-- Primary Key structure for table SYS_LOG_MQ
-- ----------------------------
ALTER TABLE "SPMS"."SYS_LOG_MQ" ADD CONSTRAINT "SYS_LOG_MQ_PK" PRIMARY KEY ("UUID");

-- ----------------------------
-- Checks structure for table SYS_LOG_MQ
-- ----------------------------
ALTER TABLE "SPMS"."SYS_LOG_MQ" ADD CONSTRAINT "SYS_C0016726" CHECK ("UUID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Indexes structure for table SYS_LOG_MQ
-- ----------------------------
CREATE INDEX "SPMS"."INDEX_SYS_LOG_MQ_AUTO_ID"
  ON "SPMS"."SYS_LOG_MQ" ("LOG_AUTO_ID" ASC)
  LOGGING
  VISIBLE
PCTFREE 10
INITRANS 2
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
  FLASH_CACHE DEFAULT
)
   USABLE;

-- ----------------------------
-- Triggers structure for table SYS_LOG_MQ
-- ----------------------------
CREATE TRIGGER "SPMS"."TR_SYS_LOG_MQ_BEF" BEFORE INSERT ON "SPMS"."SYS_LOG_MQ" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW 
DECLARE
    V_NUM1 NUMBER := 0;
BEGIN
    SELECT NVL(TO_NUMBER(MAX(LOG.LOG_AUTO_ID)), 0) INTO V_NUM1 FROM SYS_LOG_MQ LOG;
    :NEW.LOG_AUTO_ID := V_NUM1 + 1;
END;
/

-- ----------------------------
-- Primary Key structure for table WERKS
-- ----------------------------
ALTER TABLE "SPMS"."WERKS" ADD CONSTRAINT "SYS_C0010790" PRIMARY KEY ("WERKS");

-- ----------------------------
-- Checks structure for table WERKS
-- ----------------------------
ALTER TABLE "SPMS"."WERKS" ADD CONSTRAINT "SYS_C0013813" CHECK ("WERKS" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Indexes structure for table WHS
-- ----------------------------
CREATE INDEX "SPMS"."WHS_WERKS_LOCATION_CODE"
  ON "SPMS"."WHS" ("WERKS" ASC, "WHS_LOCATION_CODE" ASC)
  LOGGING
  VISIBLE
PCTFREE 10
INITRANS 2
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
  FLASH_CACHE DEFAULT
)
   USABLE;

-- ----------------------------
-- Primary Key structure for table WHS_DUMP
-- ----------------------------
ALTER TABLE "SPMS"."WHS_DUMP" ADD CONSTRAINT "WHS_DUMP_PK" PRIMARY KEY ("WHS_DUMP_UUID");

-- ----------------------------
-- Checks structure for table WHS_DUMP
-- ----------------------------
ALTER TABLE "SPMS"."WHS_DUMP" ADD CONSTRAINT "SYS_C0026526" CHECK ("WHS_DUMP_UUID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Indexes structure for table WHS_DUMP
-- ----------------------------
CREATE UNIQUE INDEX "SPMS"."WHS_DUMP_WHS_DUMP_UUID_UINDEX"
  ON "SPMS"."WHS_DUMP" ("WHS_DUMP_UUID" ASC)
  LOGGING
  VISIBLE
PCTFREE 10
INITRANS 2
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
  FLASH_CACHE DEFAULT
)
   USABLE;

-- ----------------------------
-- Triggers structure for table WHS_DUMP
-- ----------------------------
CREATE TRIGGER "SPMS"."TR_WHS_DUMP_BEF" BEFORE INSERT ON "SPMS"."WHS_DUMP" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW 
DECLARE
    V_NUM1 NUMBER := 0;
BEGIN
    SELECT NVL(TO_NUMBER(SUBSTR(MAX(WD.WHS_DUMP_NO), -3, 3)), 0) INTO V_NUM1 FROM WHS_DUMP WD
    WHERE WD.CREATE_DATE = :NEW.CREATE_DATE
      AND WD.WERKS_DUMP_OUT = :NEW.WERKS_DUMP_OUT
      AND WD.WHS_LOCATION_CODE_DUMP_OUT = :NEW.WHS_LOCATION_CODE_DUMP_OUT;
    :NEW.WHS_DUMP_NO := :NEW.WERKS_DUMP_OUT||'-'||:NEW.WHS_LOCATION_CODE_DUMP_OUT||'-'||REPLACE(:NEW.CREATE_DATE, '-')||'-'|| SUBSTR(1001 + V_NUM1, 2, 4);
END;
/

-- ----------------------------
-- Triggers structure for table WHS_INVENTORY_INFO
-- ----------------------------
CREATE TRIGGER "SPMS"."TR_WHS_INVENTORY_INFO_BEF" BEFORE UPDATE ON "SPMS"."WHS_INVENTORY_INFO" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW 
BEGIN
:new.UPDATE_TIME := TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss');
END;
/

-- ----------------------------
-- Primary Key structure for table WHS_MOVE
-- ----------------------------
ALTER TABLE "SPMS"."WHS_MOVE" ADD CONSTRAINT "WHS_MOVE_PK" PRIMARY KEY ("WHS_MOVE_UUID");

-- ----------------------------
-- Checks structure for table WHS_MOVE
-- ----------------------------
ALTER TABLE "SPMS"."WHS_MOVE" ADD CONSTRAINT "SYS_C0022716" CHECK ("WHS_MOVE_UUID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Triggers structure for table WHS_MOVE
-- ----------------------------
CREATE TRIGGER "SPMS"."TR_WHS_MOVE_BEF" BEFORE INSERT ON "SPMS"."WHS_MOVE" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW 
DECLARE
    V_NUM1 NUMBER := 0;
BEGIN
    SELECT NVL(TO_NUMBER(SUBSTR(MAX(WM.WHS_MOVE_NO), -3, 3)), 0) INTO V_NUM1 FROM WHS_MOVE WM
    WHERE WM.CREATE_DATE = :NEW.CREATE_DATE
      AND WM.WERKS_MOVE_OUT = :NEW.WERKS_MOVE_OUT;
    :NEW.WHS_MOVE_NO := :NEW.WERKS_MOVE_OUT||'-'||REPLACE(:NEW.CREATE_DATE, '-')||'-'|| SUBSTR(1001 + V_NUM1, 2, 4);
END;
/

-- ----------------------------
-- Primary Key structure for table WHS_MOVE_DTL
-- ----------------------------
ALTER TABLE "SPMS"."WHS_MOVE_DTL" ADD CONSTRAINT "WHS_MOVE_DTL_PK" PRIMARY KEY ("AUTO_ID");

-- ----------------------------
-- Checks structure for table WHS_MOVE_DTL
-- ----------------------------
ALTER TABLE "SPMS"."WHS_MOVE_DTL" ADD CONSTRAINT "SYS_C0022718" CHECK ("AUTO_ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Triggers structure for table WHS_MOVE_DTL
-- ----------------------------
CREATE TRIGGER "SPMS"."TR_WHS_MOVE_DTL_BEF" BEFORE INSERT ON "SPMS"."WHS_MOVE_DTL" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW 
DECLARE
    V_NUM1 NUMBER := 0;
BEGIN
    SELECT NVL(TO_NUMBER(MAX(WDM.AUTO_ID)), 0) INTO V_NUM1 FROM WHS_MOVE_DTL WDM;
    :NEW.AUTO_ID := V_NUM1 + 1;
END;
/

-- ----------------------------
-- Primary Key structure for table WHS_OPERATE_LOG
-- ----------------------------
ALTER TABLE "SPMS"."WHS_OPERATE_LOG" ADD CONSTRAINT "WHS_OPERATE_LOG_PK" PRIMARY KEY ("LOG_ID");

-- ----------------------------
-- Checks structure for table WHS_OPERATE_LOG
-- ----------------------------
ALTER TABLE "SPMS"."WHS_OPERATE_LOG" ADD CONSTRAINT "SYS_C0015245" CHECK ("LOG_ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Indexes structure for table WHS_OPERATE_LOG
-- ----------------------------
CREATE INDEX "SPMS"."INDEX_WHS_OPERATE_LOG_AUTO_ID"
  ON "SPMS"."WHS_OPERATE_LOG" ("LOG_AUTO_ID" ASC)
  LOGGING
  VISIBLE
PCTFREE 10
INITRANS 2
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
  FLASH_CACHE DEFAULT
)
   USABLE;

-- ----------------------------
-- Triggers structure for table WHS_OPERATE_LOG
-- ----------------------------
CREATE TRIGGER "SPMS"."TR_WHS_OPERATE_LOG_BEF" BEFORE INSERT ON "SPMS"."WHS_OPERATE_LOG" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW 
DECLARE
    V_NUM1 NUMBER := 0;
BEGIN
    SELECT NVL(TO_NUMBER(MAX(LOG.LOG_AUTO_ID)), 0) INTO V_NUM1 FROM WHS_OPERATE_LOG LOG;
    :NEW.LOG_AUTO_ID := V_NUM1 + 1;
END;
/

-- ----------------------------
-- Primary Key structure for table WHS_OTHER_DTL
-- ----------------------------
ALTER TABLE "SPMS"."WHS_OTHER_DTL" ADD CONSTRAINT "WHS_OTHER_DTL_PK" PRIMARY KEY ("AUTO_ID");

-- ----------------------------
-- Checks structure for table WHS_OTHER_DTL
-- ----------------------------
ALTER TABLE "SPMS"."WHS_OTHER_DTL" ADD CONSTRAINT "SYS_C0030212" CHECK ("AUTO_ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Triggers structure for table WHS_OTHER_DTL
-- ----------------------------
CREATE TRIGGER "SPMS"."TR_WHS_OTHER_DTL_BEF" BEFORE INSERT ON "SPMS"."WHS_OTHER_DTL" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW 
DECLARE
    V_NUM1 NUMBER := 0;
BEGIN
    SELECT NVL(TO_NUMBER(MAX(WOD.AUTO_ID)), 0) INTO V_NUM1 FROM WHS_OTHER_DTL WOD;
    :NEW.AUTO_ID := V_NUM1 + 1;
END;
/

-- ----------------------------
-- Primary Key structure for table WHS_OTHER_TASK
-- ----------------------------
ALTER TABLE "SPMS"."WHS_OTHER_TASK" ADD CONSTRAINT "WHS_OTHER_TASK_PK" PRIMARY KEY ("UUID");

-- ----------------------------
-- Checks structure for table WHS_OTHER_TASK
-- ----------------------------
ALTER TABLE "SPMS"."WHS_OTHER_TASK" ADD CONSTRAINT "SYS_C0030210" CHECK ("UUID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Triggers structure for table WHS_OTHER_TASK
-- ----------------------------
CREATE TRIGGER "SPMS"."TR_WHS_OTHER_TASK_BEF" BEFORE INSERT ON "SPMS"."WHS_OTHER_TASK" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW 
DECLARE
    V_NUM1 NUMBER := 0;
BEGIN
    SELECT NVL(TO_NUMBER(SUBSTR(MAX(WO.SPMS_ID), -3, 3)), 0) INTO V_NUM1 FROM WHS_OTHER_TASK WO
    WHERE WO.CREATE_DATE = :NEW.CREATE_DATE
      AND WO.WERKS = :NEW.WERKS
      AND WO.WHS_LOCATION_CODE = :NEW.WHS_LOCATION_CODE;
    :NEW.SPMS_ID := :NEW.WERKS||'-'||:NEW.WHS_LOCATION_CODE||'-'||REPLACE(:NEW.CREATE_DATE, '-')||'-'|| SUBSTR(1001 + V_NUM1, 2, 4);
END;
/

-- ----------------------------
-- Primary Key structure for table WHS_OUT
-- ----------------------------
ALTER TABLE "SPMS"."WHS_OUT" ADD CONSTRAINT "WHS_OUT_PK" PRIMARY KEY ("UUID");

-- ----------------------------
-- Checks structure for table WHS_OUT
-- ----------------------------
ALTER TABLE "SPMS"."WHS_OUT" ADD CONSTRAINT "SYS_C0015251" CHECK ("UUID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Triggers structure for table WHS_OUT
-- ----------------------------
CREATE TRIGGER "SPMS"."TR_WHS_OUT_BEF" BEFORE INSERT ON "SPMS"."WHS_OUT" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW 
DECLARE
    V_NUM1 NUMBER := 0;
BEGIN
    SELECT NVL(TO_NUMBER(SUBSTR(MAX(WO.WHS_OUT_NO), -3, 3)), 0) INTO V_NUM1 FROM WHS_OUT WO
    WHERE WO.CREATE_DATE = :NEW.CREATE_DATE
      AND WO.WERKS = :NEW.WERKS
      AND WO.WHS_LOCATION_CODE = :NEW.WHS_LOCATION_CODE;
    :NEW.WHS_OUT_NO := :NEW.WERKS||'-'||:NEW.WHS_LOCATION_CODE||'-'||REPLACE(:NEW.CREATE_DATE, '-')||'-'|| SUBSTR(1001 + V_NUM1, 2, 4);
END;
/

-- ----------------------------
-- Primary Key structure for table WHS_REPACKAGE_DTL
-- ----------------------------
ALTER TABLE "SPMS"."WHS_REPACKAGE_DTL" ADD CONSTRAINT "SYS_C0030497" PRIMARY KEY ("UUID");

-- ----------------------------
-- Checks structure for table WHS_REPACKAGE_DTL
-- ----------------------------
ALTER TABLE "SPMS"."WHS_REPACKAGE_DTL" ADD CONSTRAINT "SYS_C0030496" CHECK ("UUID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Primary Key structure for table WHS_REPACKAGE_NOTE
-- ----------------------------
ALTER TABLE "SPMS"."WHS_REPACKAGE_NOTE" ADD CONSTRAINT "SYS_C0030499" PRIMARY KEY ("REPACKAGE_BILL_NO");

-- ----------------------------
-- Checks structure for table WHS_REPACKAGE_NOTE
-- ----------------------------
ALTER TABLE "SPMS"."WHS_REPACKAGE_NOTE" ADD CONSTRAINT "SYS_C0030498" CHECK ("REPACKAGE_BILL_NO" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Primary Key structure for table WHS_STORAGE
-- ----------------------------
ALTER TABLE "SPMS"."WHS_STORAGE" ADD CONSTRAINT "WHS_STORAGE_PK" PRIMARY KEY ("UUID");

-- ----------------------------
-- Checks structure for table WHS_STORAGE
-- ----------------------------
ALTER TABLE "SPMS"."WHS_STORAGE" ADD CONSTRAINT "SYS_C0013815" CHECK ("UUID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Triggers structure for table WHS_STORAGE_INVENTORY
-- ----------------------------
CREATE TRIGGER "SPMS"."TR_WHS_STORAGE_INVENTORY_BEF" BEFORE UPDATE ON "SPMS"."WHS_STORAGE_INVENTORY" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW 
BEGIN
:new.UPDATE_TIME := TO_DATE(TO_CHAR(SYS_EXTRACT_UTC(SYSTIMESTAMP), 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss');
END;
/

-- ----------------------------
-- Checks structure for table WITHDRAW_TASK
-- ----------------------------
ALTER TABLE "SPMS"."WITHDRAW_TASK" ADD CONSTRAINT "SYS_C0015248" CHECK ("UUID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- 海外仓其他出入库新增和变更需求 20220307
-- ----------------------------

comment on column OVERSEA_OTHER_TASK.MOVEMENT_TYPE is '报废出库551;零价格出库Z55;零价格入库Z56;收货多收Z16;串货调整309;不可抗力出库Z13;IT专用出库Z47;期初库存增加561;期初库存减少562;建安固定资产领用Z57;建安固定资产领用撤销Z58;'
/

alter table OVERSEA_OTHER_DTL
    add INTERNAL_ORDER_NUMBER VARCHAR2(32)
/

comment on column OVERSEA_OTHER_DTL.INTERNAL_ORDER_NUMBER is '内部订单号(Z57,Z58)'
/

alter table OVERSEA_OTHER_DTL
    add LOCAL_CURRENCY NUMBER(15,3)
/

comment on column OVERSEA_OTHER_DTL.LOCAL_CURRENCY is '本币金额(Z561,Z562)'
/














